From 9dd266e85a56abbbf308aa4bbad7cc807c0d77bf Mon Sep 17 00:00:00 2001 From: "Frederick F. Kautz IV" Date: Mon, 27 Feb 2017 18:30:58 -0800 Subject: [PATCH] Guard against null dereference when no workers are running --- src/worker.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/worker.c b/src/worker.c index 332b098..4a48858 100644 --- a/src/worker.c +++ b/src/worker.c @@ -1875,6 +1875,10 @@ void workers_stop(int stop_all) * It's cool enough to be able to reconfigure at all. */ w = worker_threads; + if (w == NULL) { + hlog(LOG_CRIT, "Cannot stop worker threads, none running"); + abort(); + } while ((w) && (w->next)) w = w->next;