From: Felix Fietkau Date: Wed, 14 Jun 2017 10:08:42 +0000 (+0200) Subject: runqueue: fix use-after-free bug X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cfc75c5e8ceca80dd9ca28eec3ddfdfa19bb8be2;p=oweals%2Flibubox.git runqueue: fix use-after-free bug Calling t->complete in runqueue_task_complete can free the memory associated with t. Change the runqueue_start_next accordingly. Fixes https://github.com/openwrt/openwrt/issues/493 Signed-off-by: Felix Fietkau --- diff --git a/runqueue.c b/runqueue.c index 1d9fa4b..a1d0133 100644 --- a/runqueue.c +++ b/runqueue.c @@ -232,7 +232,7 @@ void runqueue_task_complete(struct runqueue_task *t) t->cancelled = false; if (t->complete) t->complete(q, t); - runqueue_start_next(t->q); + runqueue_start_next(q); } static void