http-fetch: do not SEGV after fetching a bad pack idx file
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jul 18, 2008 at 00:11 UTC
a70c232e0fcb1a72cec024def0f8b1377f15daf4
1 file changed
+2
http-walker.c
+2
@@ -442,6 +442,8 @@ static int setup_index(struct walker *walker, struct alt_base *repo, unsigned ch
442
return -1;
443
444
new_pack = parse_pack_index(sha1);
445
+ if (!new_pack)
446
+ return -1; /* parse_pack_index() already issued error message */
447
new_pack->next = repo->packs;
448
repo->packs = new_pack;
449
return 0;