git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] fix xstrdup leak in parse_short_opt
@ 2025-05-07  2:33 Lidong Yan via GitGitGadget
  2025-05-07  2:33 ` [PATCH 1/3] " Lidong Yan via GitGitGadget
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Lidong Yan via GitGitGadget @ 2025-05-07  2:33 UTC (permalink / raw)
  To: git; +Cc: Lidong Yan

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
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-05-09 14:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07  2:33 [PATCH 0/3] fix xstrdup leak in parse_short_opt Lidong Yan via GitGitGadget
2025-05-07  2:33 ` [PATCH 1/3] " Lidong Yan via GitGitGadget
2025-05-07  7:54   ` Patrick Steinhardt
2025-05-07  2:33 ` [PATCH 2/3] fix: replace bug where int was incorrectly used as bool Lidong Yan via GitGitGadget
2025-05-07  7:54   ` Patrick Steinhardt
2025-05-07  2:33 ` [PATCH 3/3] fix: use strvec_push_wrapper to prevent ubsan failure Lidong Yan via GitGitGadget
2025-05-07  7:54   ` Patrick Steinhardt
2025-05-07 12:19     ` lidongyan
2025-05-07 13:24 ` [PATCH v2] parse-options: fix xstrdup leak in parse_options_step parse-options:984 Lidong Yan via GitGitGadget
2025-05-09  6:19   ` Patrick Steinhardt
2025-05-09  7:35     ` lidongyan
2025-05-09 13:08     ` Phillip Wood
2025-05-09 13:43       ` lidongyan
2025-05-09 14:28   ` [PATCH v3] parse-options: fix memory leak when calling `parse_options` Lidong Yan via GitGitGadget

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).