eloop: Fix crash on signal handler cancelling next timeout
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 28 May 2010 19:18:28 +0000 (22:18 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 28 May 2010 19:18:28 +0000 (22:18 +0300)
It is possible that the timeout pointer becomes invalid in one of the
signal handlers, so we need to reload the pointer after those.

src/utils/eloop.c

index ac99989..4b61598 100644 (file)
@@ -529,6 +529,8 @@ void eloop_run(void)
                eloop_process_pending_signals();
 
                /* check if some registered timeouts have occurred */
+               timeout = dl_list_first(&eloop.timeout, struct eloop_timeout,
+                                       list);
                if (timeout) {
                        os_get_time(&now);
                        if (!os_time_before(&now, &timeout->time)) {