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

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

From
Jeff King <peff@peff.net>
Date
May 1, 2025, 16:38 UTC
Message-ID
<20250501163822.GE1795346@coredump.intra.peff.net>
In-Reply-To
<xmqq4iy4z55h.fsf@gitster.g>
On Thu, May 01, 2025 at 09:07:06AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> >  	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().

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 12 in “[BUG] rebase: can write reflog with uninit. `action` string”
  1. Kristoffer HaugsbakkApr 28, 2025
  2. Phillip WoodApr 29, 2025
  3. Kristoffer HaugsbakkApr 29, 2025
  4. Jeff KingApr 29, 2025
  5. Kristoffer HaugsbakkApr 30, 2025
  6. Jeff KingMay 1, 2025
  7. phillip.wood123@gmail.comMay 1, 2025
  8. Jeff KingMay 1, 2025
  9. Junio C HamanoMay 1, 2025
  10. Jeff KingMay 1, 2025
  11. Junio C HamanoMay 1, 2025
  12. phillip.wood123@gmail.comMay 1, 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.