Skip to content

fix xstrdup leak in parse_short_opt

Lidong Yan via GitGitGadget git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fix xstrdup leak in parse_short_optMakefile parse-options.c parse-options.h +5 more+81 -11 reply
2/3fix: replace bug where int was incorrectly used as boolparse-options.c parse-options.h t/helper/test-free-unknown-options.c +1 more+38 -311 reply
3/3fix: use strvec_push_wrapper to prevent ubsan failuret/helper/test-free-unknown-options.c+7 -12 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] fix xstrdup leak in parse_short_opt

Pass a usered defined strdup-like function a parse_opt_ctx to avoid memory leak.

Lidong Yan (3):
fix xstrdup leak in parse_short_opt
fix: replace bug where int was incorrectly used as bool
fix: use strvec_push_wrapper to prevent ubsan failure

 Makefile                             |  1 +
 parse-options.c                      | 23 ++++++++++++++-
 parse-options.h                      | 12 ++++++++
 t/helper/meson.build                 |  1 +
 t/helper/test-free-unknown-options.c | 42 ++++++++++++++++++++++++++++
 t/helper/test-tool.c                 |  1 +
 t/helper/test-tool.h                 |  1 +
 t/t0040-parse-options.sh             | 14 ++++++++++
 8 files changed, 94 insertions(+), 1 deletion(-)
 create mode 100644 t/helper/test-free-unknown-options.c

base-commit: 6f84262c44a89851c3ae5a6e4c1a9d06b2068d75
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1954%2Fbrandb97%2Ffix-parse-option-leak-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1954/brandb97/fix-parse-option-leak-v1
Pull-Request: https://github.com/git/git/pull/1954

Signature · 1 line
gitgitgadget