{"thread":{"id":"19687","subject":"[PATCH 10/23] http-push: do not SEGV after fetching a bad pack idx file","startedAt":"2009-06-05T16:04:47Z","lastAt":"2009-06-05T16:04:47Z","messageCount":1,"participants":["Tay Ray Chuan"],"isPatch":true,"patchVersion":1,"patchTotal":23},"messages":[{"id":"115523","messageId":"20090606000447.d0f803bc.rctay89@gmail.com","threadId":"19687","inReplyTo":null,"subject":"[PATCH 10/23] http-push: do not SEGV after fetching a bad pack idx file","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-06-05T16:04:47Z","receivedAt":"2009-06-05T16:04:47Z","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 c8cb6e4..a6ca2ac 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1065,6 +1065,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.1\n"}]}