1. Stefan Saasen
  2. git


Nick Hengeveld  committed e8dff6b

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>

  • Participants
  • Parent commits 5ad312b
  • Branches master

Comments (0)

Files changed (1)

File http-fetch.c

View file
  • Ignore whitespace
 	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) {