Re: bugreport - SEGFAULT on 'git show-branch --current --reflog=3'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



By my side, your first suggestion didn't remove the segfault due to the
irrelevant check on 'reflog[i]' that is not use on next line, so unable
to segfault. The fact is you pointed the exact place where it happens
and my fix of your fix :) remove the segfault.

On 13/04/2022 18:46, Ævar Arnfjörð Bjarmason wrote:
> 
> On Wed, Apr 13 2022, Gregory David wrote:
> 
>> [[PGP Signed Part:Undecided]]
>> Thanks a lot Aevar!
>>
>> Don't you mean this:
>>
>> diff --git a/builtin/show-branch.c b/builtin/show-branch.c
>> index 330b0553b9..2a5c31729d 100644
>> --- a/builtin/show-branch.c
>> +++ b/builtin/show-branch.c
>> @@ -881,7 +881,7 @@ int cmd_show_branch(int ac, const char **av, const
>> char *prefix)
>>                                        get_color_reset_code(), ref_name[i]);
>>                         }
>>
>> -                       if (!reflog) {
>> +                       if (!reflog || !rev[i]) {
>>                                 /* header lines never need name */
>>                                 show_one_commit(rev[i], 1);
> 
> No, but my "suggested" fix was just enough to compile and get past the
> segfault, i.e. we don't reach the puts(reflog_msg[i]) branch, but of
> course rev[i] may be NULL too, I didn't check.
> 
> For this one though: I haven't tried it, but reading show_one_commit()
> one of the first things we do is dereference the 1st argument, so surely
> that will segfault too...

-- 
Gregory David
Security Engineer
https://www.p1sec.com

Attachment: OpenPGP_0xA6DF37692E5DE2F7.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux