Re: [BUG] rebase: can write reflog with uninit. `action` string

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Thu, May 01, 2025 at 09:07:06AM -0700, Junio C Hamano wrote:
>
>> >  	va_start(ap, fmt);
>> > -	strbuf_reset(&buf);
>> > +	strbuf_release(&buf); /* guarantees realloaction */
>> 
>> I initially thought that this comment may have to be updated in the
>> production version, but because we have to freshly allocate for each
>> new message for ownership change, this comment still is correct.
>> The only difference between the "here is how to expose" and "this is
>> part of the smallest solution" is why we want to guarantee it.
>
> This code change is just to stimulate the bug more readily. ;)
>
> I think if we started to actually allocate here, we'd want to switch the
> "return buf.buf" at the end to strbuf_detach().

That's sensible.




[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