summaryrefslogtreecommitdiff
path: root/http-fetch.c
diff options
context:
space:
mode:
authorNick Hengeveld <nickh@reactrix.com>2006-06-07 05:22:35 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-07 05:32:51 (GMT)
commite8dff6ba8b12db94b728ff4d0ebf65040de92c37 (patch)
tree10cb9af38cfe5ae817a31099d172099edb654541 /http-fetch.c
parent5ad312bedede83f63de5e69ef5e5ddff46484eae (diff)
downloadgit-e8dff6ba8b12db94b728ff4d0ebf65040de92c37.zip
git-e8dff6ba8b12db94b728ff4d0ebf65040de92c37.tar.gz
git-e8dff6ba8b12db94b728ff4d0ebf65040de92c37.tar.bz2
http-fetch: fix possible segfault
Initialize an object request's slot to a safe value. A non-NULL value can cause a segfault if the request is aborted before it starts. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http-fetch.c')
-rw-r--r--http-fetch.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/http-fetch.c b/http-fetch.c
index 661c909..d3602b7 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -399,6 +399,7 @@ void prefetch(unsigned char *sha1)
snprintf(newreq->filename, sizeof(newreq->filename), "%s", filename);
snprintf(newreq->tmpfile, sizeof(newreq->tmpfile),
"%s.temp", filename);
+ newreq->slot = NULL;
newreq->next = NULL;
if (object_queue_head == NULL) {