summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-18 07:11:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-18 07:11:40 (GMT)
commita70c232e0fcb1a72cec024def0f8b1377f15daf4 (patch)
treedac3e7aba101be53e48770ada196ee458fa00b62
parentd85fe389594dc1b6f64c0aae7146a6d92399c3a9 (diff)
downloadgit-a70c232e0fcb1a72cec024def0f8b1377f15daf4.zip
git-a70c232e0fcb1a72cec024def0f8b1377f15daf4.tar.gz
git-a70c232e0fcb1a72cec024def0f8b1377f15daf4.tar.bz2
http-fetch: do not SEGV after fetching a bad pack idx file
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--http-walker.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/http-walker.c b/http-walker.c
index 99f397e..7403306 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -442,6 +442,8 @@ static int setup_index(struct walker *walker, struct alt_base *repo, unsigned ch
return -1;
new_pack = parse_pack_index(sha1);
+ if (!new_pack)
+ return -1; /* parse_pack_index() already issued error message */
new_pack->next = repo->packs;
repo->packs = new_pack;
return 0;