{"thread":{"id":"19373","subject":"[PATCH 05/11] http-push: do not SEGV after fetching a bad pack idx file","startedAt":"2009-05-16T03:51:41Z","lastAt":"2009-05-16T03:51:41Z","messageCount":1,"participants":["Tay Ray Chuan"],"isPatch":true,"patchVersion":1,"patchTotal":11},"messages":[{"id":"114065","messageId":"20090516115141.58c5dc39.rctay89@gmail.com","threadId":"19373","inReplyTo":null,"subject":"[PATCH 05/11] http-push: do not SEGV after fetching a bad pack idx file","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-05-16T03:51:41Z","receivedAt":"2009-05-16T03:51:41Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"In a70c232 (\"http-fetch: do not SEGV after fetching a bad pack idx\nfile\"), changes were made to the setup_index method in http-fetch.c\n(known in its present form as http-walker.c after 30ae764 (\"Modularize\ncommit-walker\")). Since http-push.c has similar similar code for\nprocessing index files, these changes should apply to http-push.c's\nimplementation of setup_index as well.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n http-push.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex 1011ca8..875b2c6 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1060,6 +1060,8 @@ static int setup_index(unsigned char *sha1)\n \t\treturn -1;\n \n \tnew_pack = parse_pack_index(sha1);\n+\tif (!new_pack)\n+\t\treturn -1; /* parse_pack_index() already issued error message */\n \tnew_pack->next = repo->packs;\n \trepo->packs = new_pack;\n \treturn 0;\n-- \n1.6.3.rc0\n"}]}