mbox series

[v2,0/2] bugreport.c: fix a crash in git bugreport with --no-suffix option

Message ID pull.1693.v2.git.1710388817.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series bugreport.c: fix a crash in git bugreport with --no-suffix option | expand

Message

Jean-Noël Avila via GitGitGadget March 14, 2024, 4 a.m. UTC
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().

Jiamu Sun (2):
  bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option
  doc: update doc file and usage for git-bugreport

 Documentation/git-bugreport.txt |  6 +++++-
 builtin/bugreport.c             | 10 +++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)


base-commit: 945115026aa63df4ab849ab14a04da31623abece
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1693%2Fbarroit%2Ffix-bugreport-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1693/barroit/fix-bugreport-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1693

Range-diff vs v1:

 1:  9c6f3f5203a = 1:  9c6f3f5203a bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option
 -:  ----------- > 2:  868cec05ed5 doc: update doc file and usage for git-bugreport

Comments

Junio C Hamano March 14, 2024, 4:27 p.m. UTC | #1
"barroit via GitGitGadget" <gitgitgadget@gmail.com> writes:

> 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().
>
> Jiamu Sun (2):
>   bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option
>   doc: update doc file and usage for git-bugreport

Squash them together into a single patch.  As you didn't have any
meaningful log message in [2/2], unless there are other things that
need to be updated and v3 is needed, I can squash them into one
commit, though.

Thanks for updating.
Junio C Hamano March 14, 2024, 4:33 p.m. UTC | #2
Junio C Hamano <gitster@pobox.com> writes:

> "barroit via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> 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().
>>
>> Jiamu Sun (2):
>>   bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option
>>   doc: update doc file and usage for git-bugreport
>
> Squash them together into a single patch.  As you didn't have any
> meaningful log message in [2/2], unless there are other things that
> need to be updated and v3 is needed, I can squash them into one
> commit, though.
>
> Thanks for updating.

I forgot the two I CC'ed the review thread for the previous round to
ping them, so here it is.

Thanks.
Jiamu Sun March 15, 2024, 10:42 p.m. UTC | #3
Jiamu Sun <barroit@linux.com> writes:

> Junio C Hamano <gitster@pobox.com> writes:
>
> I forgot the two I CC'ed the review thread for the previous round to
> ping them, so here it is.
>
> Thanks.

I've updated patch 3; this should hopefully be fine now.

Sorry for the trouble, and thanks for all your help, especially as
it's my first PR.