@matheusbsbs / matheus-bagliano / commits / 1b1b7b235b
Fork 0

http-push: do not SEGV after fetching a bad pack idx file

In a70c232 ("http-fetch: do not SEGV after fetching a bad pack idx file"), changes were made to the setup_index method in http-fetch.c (known in its present form as http-walker.c after 30ae764 ("Modularize commit-walker")). Since http-push.c has similar similar code for processing index files, these changes should apply to http-push.c's implementation of setup_index as well. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Tay Ray Chuan committed Jun 6, 2009 at 16:43 UTC 1b1b7b235b040f27952d48ab8811c958a1f6d052
1 file changed +2
http-push.c
+2
@@ -1065,6 +1065,8 @@ static int setup_index(unsigned char *sha1)
1065 return -1;
1066
1067 new_pack = parse_pack_index(sha1);
1068 + if (!new_pack)
1069 + return -1; /* parse_pack_index() already issued error message */
1070 new_pack->next = repo->packs;
1071 repo->packs = new_pack;
1072 return 0;