@matheusbsbs / matheus-bagliano / commits / e8dff6ba8b
Fork 0

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>

Nick Hengeveld committed Jun 6, 2006 at 22:22 UTC e8dff6ba8b12db94b728ff4d0ebf65040de92c37
1 file changed +1
http-fetch.c
+1
@@ -399,6 +399,7 @@ void prefetch(unsigned char *sha1)
399 snprintf(newreq->filename, sizeof(newreq->filename), "%s", filename);
400 snprintf(newreq->tmpfile, sizeof(newreq->tmpfile),
401 "%s.temp", filename);
402 + newreq->slot = NULL;
403 newreq->next = NULL;
404
405 if (object_queue_head == NULL) {