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

Re: [PATCH] Fix regression in fast-import.c due to strbufs.

From
Pierre Habouzit <madcoder@debian.org>
Date
Oct 26, 2007, 17:25 UTC
Message-ID
<20071026172523.GB5496@artemis.corp>
In-Reply-To
<20071026075912.GA25365@artemis.corp>
Dear Shun, the fast-import bug your reported has a fix.

Dear Junio, please merge the patch in the mail I'm answering to[0] into master as it fixes a crash in fast-import.

Cheers,
  [0]  Message-Id: <20071026075912.GA25365@artemis.corp>
diff --git a/fast-import.c b/fast-import.c
index 6f888f6..f93d7d6 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1616,6 +1616,7 @@ static void cmd_data(struct strbuf *sb)
 		char *term = xstrdup(command_buf.buf + 5 + 2);
 		size_t term_len = command_buf.len - 5 - 2;
 
+		strbuf_detach(&command_buf, NULL);
 		for (;;) {
 			if (strbuf_getline(&command_buf, stdin, '\n') == EOF)
 				die("EOF in data (terminator '%s' not found)", term);
-- 
1.5.3.4.1358.gfae55-dirty




-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: cpettittNext: Shun Kei Leung
Message 5 of 7 in “git-fast-import segfaults”
  1. cpettittOct 26, 2007
  2. Shawn O. PearceOct 26, 2007
  3. Fix regression in fast-import.c due to strbufs.Pierre Habouzit, Oct 26, 2007
  4. cpettittOct 26, 2007
  5. Pierre HabouzitOct 26, 2007
  6. Shun Kei LeungOct 29, 2007
  7. Pierre HabouzitOct 29, 2007

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.