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>
This commit is contained in:
parent
5ad312bede
commit
e8dff6ba8b
@ -399,6 +399,7 @@ void prefetch(unsigned char *sha1)
|
|||||||
snprintf(newreq->filename, sizeof(newreq->filename), "%s", filename);
|
snprintf(newreq->filename, sizeof(newreq->filename), "%s", filename);
|
||||||
snprintf(newreq->tmpfile, sizeof(newreq->tmpfile),
|
snprintf(newreq->tmpfile, sizeof(newreq->tmpfile),
|
||||||
"%s.temp", filename);
|
"%s.temp", filename);
|
||||||
|
newreq->slot = NULL;
|
||||||
newreq->next = NULL;
|
newreq->next = NULL;
|
||||||
|
|
||||||
if (object_queue_head == NULL) {
|
if (object_queue_head == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user