{"thread":{"id":"19478","subject":"[PATCH 05/18] http-push: do not SEGV after fetching a bad pack idx file","startedAt":"2009-05-24T14:19:46Z","lastAt":"2009-05-24T14:19:46Z","messageCount":1,"participants":["Tay Ray Chuan"],"isPatch":true,"patchVersion":1,"patchTotal":18},"messages":[{"id":"114569","messageId":"20090524221946.c42d059a.rctay89@gmail.com","threadId":"19478","inReplyTo":null,"subject":"[PATCH 05/18] http-push: do not SEGV after fetching a bad pack idx file","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-05-24T14:19:46Z","receivedAt":"2009-05-24T14:19:46Z","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 9655b2c..c48bb73 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1061,6 +1061,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"}]}