From: Nick Hengeveld Date: Wed, 7 Jun 2006 05:22:35 +0000 (-0700) Subject: http-fetch: fix possible segfault X-Git-Tag: v1.4.0-rc2~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e8dff6ba8b12db94b728ff4d0ebf65040de92c37;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/http-fetch.c b/http-fetch.c index 661c90915..d3602b7d7 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) {