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

Re: Git crashes on pull

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 15, 2009, 19:22 UTC
Message-ID
<7vljkg57xs.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LSU.2.01.0909152044450.10936@bianca.dialin.t-online.de>
Guido Ostkamp <git@ostkamp.fastmail.fm> writes:
Show 11 quoted lines
> I have a clone of http://git.postgresql.org/git/postgresql.git where
> head is at commit 167501570c74390dfb7a5dd71e260ab3d4fd9904.
>
> I'm using Git version 1.6.5.rc1.10.g20f34 (should be at commit
> 20f34902d154f390ebaa7eed7f42ad14140b8acb from Mon Sep 14 10:49:01 2009
> +0200)
>
> Now when I 'git pull' then Git crashes with
>
> git pull 2>&1 > /tmp/git-error
> *** glibc detected *** git-remote-curl: free(): invalid pointer:
Please try this patch, which I have been preparing for later pushout.
From: Junio C Hamano <gitster@pobox.com>
Date: Mon, 14 Sep 2009 14:48:15 -0700
Subject: [PATCH] http.c: avoid freeing an uninitialized pointer

An earlier 59b8d38 (http.c: remove verification of remote packs) left the variable "url" uninitialized; "goto cleanup" codepath can free it which is not very nice.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 http.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/http.c b/http.c
index d0cc1b3..15926d8 100644
--- a/http.c
+++ b/http.c
@@ -866,7 +866,7 @@ static int fetch_pack_index(unsigned char *sha1, const char *base_url)
 	int ret = 0;
 	char *hex = xstrdup(sha1_to_hex(sha1));
 	char *filename;
-	char *url;
+	char *url = NULL;
 	struct strbuf buf = STRBUF_INIT;
 
 	if (has_pack_index(sha1)) {
-- 
1.6.5.rc1
Previous: Guido OstkampNext: Guido Ostkamp
Message 2 of 6 in “Git crashes on pull”
  1. Guido OstkampSep 15, 2009
  2. Junio C HamanoSep 15, 2009
  3. Guido OstkampSep 15, 2009
  4. Junio C HamanoSep 15, 2009
  5. Michael WookeySep 15, 2009
  6. Tay Ray ChuanSep 18, 2009

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.