Re: [PATCH v3] bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Mar 16, 2024, 01:56 UTC
- Message-ID
- <ZfT8UiDM3DQhRX5x@nand.local>
- In-Reply-To
- <20240314223406.79283-1-barroit@linux.com>
On Fri, Mar 15, 2024 at 07:34:06AM +0900, Jiamu Sun wrote:
Show 12 quoted lines
> executing `git bugreport --no-suffix` led to a segmentation fault > due to strbuf_addftime() being called with a NULL option_suffix > variable. This occurs because negating the "--[no-]suffix" option > causes the parser to set option_suffix to NULL, which is not > handled prior to calling strbuf_addftime(). > > By adding a NULL check, the `--no-suffix` option is now available. > Using this option disables the suffix, and the file is just named > `git-bugreport` without any disambiguation measure. > > Signed-off-by: Jiamu Sun <barroit@linux.com> > ---
Acked-by: Taylor Blau <me@ttaylorr.com>
Thanks, Taylor