From bed37796179686e13eb2c05bcd8d4bb14d85d4e0 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Sun, 26 Nov 2017 17:03:07 -0500 Subject: [PATCH] [core] fix segfault if tempdirs fill up (fixes #2843) (thx wolfram) x-ref: "lighttpd segfault if /var/tmp is full" https://redmine.lighttpd.net/issues/2843 --- src/chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chunk.c b/src/chunk.c index 1f212452..7d04fc4d 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -741,7 +741,7 @@ static void chunkqueue_remove_empty_chunks(chunkqueue *cq) { chunkqueue_remove_finished_chunks(cq); if (chunkqueue_is_empty(cq)) return; - for (c = cq->first; c->next; c = c->next) { + for (c = cq->first; c && c->next; c = c->next) { if (0 == chunk_remaining_length(c->next)) { chunk *empty = c->next; c->next = empty->next;