git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] fix: replace bug where int was incorrectly used as bool

From
Patrick Steinhardt <ps@pks.im>
Date
May 7, 2025, 07:54 UTC
Message-ID
<aBsRzPvrMrDtEVli@pks.im>
In-Reply-To
<7a5e2f295296265379551584a271a409a0ce3153.1746585203.git.gitgitgadget@gmail.com>
On Wed, May 07, 2025 at 02:33:22AM +0000, Lidong Yan via GitGitGadget wrote:
> From: Lidong Yan <502024330056@smail.nju.edu.cn>
> 
> Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>

The same is true here -- this needs to have a proper commit subject and message.

Show 15 quoted lines
> diff --git a/parse-options.c b/parse-options.c
> index 4279dfe4d313..12721b83000a 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -638,7 +638,9 @@ static int has_subcommands(const struct option *options)
>  	return 0;
>  }
>  
> -static void set_strdup_fn(struct parse_opt_ctx_t *ctx, const struct option *options) {
> +static void set_strdup_fn(struct parse_opt_ctx_t *ctx,
> +			  const struct option *options)
> +{
>  	for (; options->type != OPTION_END; options++)
>  		;
>  	if (options->value && options->strdup_fn) {

Please refrain from doing code style cleanups of code you have just introduced in the preceding commit.

Patrick
Previous: Lidong Yan via GitGitGadgetNext: Lidong Yan via GitGitGadget
Message 5 of 14 in “fix xstrdup leak in parse_short_opt”
  1. 0/3 fix xstrdup leak in parse_short_optLidong Yan via GitGitGadget, May 7, 2025
  2. 1/3 fix xstrdup leak in parse_short_optLidong Yan via GitGitGadget, May 7, 2025
  3. Patrick SteinhardtMay 7, 2025
  4. 2/3 fix: replace bug where int was incorrectly used as boolLidong Yan via GitGitGadget, May 7, 2025
  5. Patrick SteinhardtMay 7, 2025
  6. 3/3 fix: use strvec_push_wrapper to prevent ubsan failureLidong Yan via GitGitGadget, May 7, 2025
  7. Patrick SteinhardtMay 7, 2025
  8. lidongyanMay 7, 2025
  9. parse-options: fix xstrdup leak in parse_options_step parse-options:984Lidong Yan via GitGitGadget, May 7, 2025
  10. Patrick SteinhardtMay 9, 2025
  11. lidongyanMay 9, 2025
  12. Phillip WoodMay 9, 2025
  13. lidongyanMay 9, 2025
  14. parse-options: fix memory leak when calling `parse_options`Lidong Yan via GitGitGadget, May 9, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.