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

Re: [PATCH] strbuf_getwholeline: NUL-terminate getdelim buffer on error

From
Jeff King <peff@peff.net>
Date
Mar 5, 2016, 19:36 UTC
Message-ID
<20160305193640.GA20701@sigill.intra.peff.net>
In-Reply-To
<xmqqziucu3d7.fsf@gitster.mtv.corp.google.com>
On Sat, Mar 05, 2016 at 11:33:08AM -0800, Junio C Hamano wrote:
Show 8 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > Not a big rush for 2.8.0-rc, as the bug is in v2.5.0, and I doubt
> > there's an easy trigger besides fast-import. But it might be harmless
> > enough to squeeze in.
> 
> Was it found by a real-world debugging session, or by a code
> inspection?  I'd be really impressed if it were the latter ;-)
Sorry to disappoint, but it was the former. :)
I found (and am fixing) a _different_ bug with:
  {
	echo "tag foo"
	echo "from HEAD:./bar"
  } | git fast-import
and I wondered if fast-import would take:
  echo "tag foo from HEAD:./bar"

on one line. The answer is no, btw, but it also tickles this bug (it is expecting "from ..." on the next line, and handles EOF by detecting the empty string).

-Peff
Previous: Junio C Hamano
Message 3 of 3 in “strbuf_getwholeline: NUL-terminate getdelim buffer on error”
  1. strbuf_getwholeline: NUL-terminate getdelim buffer on errorJeff King, Mar 5, 2016
  2. Junio C HamanoMar 5, 2016
  3. Jeff KingMar 5, 2016

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.