don't crash
authorStefan Metzmacher <metze@samba.org>
Fri, 25 Sep 2009 23:17:58 +0000 (01:17 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Sep 2009 08:52:52 +0000 (10:52 +0200)
lib/tevent/tevent_signal.c

index d3325b67ac06a4dced5c96307299bd352325d7ef..46bcfca5e90681472745608994343ad9848f34d3 100644 (file)
@@ -94,6 +94,8 @@ static void tevent_common_signal_handler(int signum)
        for (sl = sig_state->sig_handlers[signum]; sl; sl = sl->next) {
                if (sl->se->event_ctx != ev) {
                        ev = sl->se->event_ctx;
        for (sl = sig_state->sig_handlers[signum]; sl; sl = sl->next) {
                if (sl->se->event_ctx != ev) {
                        ev = sl->se->event_ctx;
+                       if (!ev) continue;
+                       if (!ev->pipe_fds) continue;
                        /* doesn't matter if this pipe overflows */
                        res = write(ev->pipe_fds[1], &c, 1);
                }
                        /* doesn't matter if this pipe overflows */
                        res = write(ev->pipe_fds[1], &c, 1);
                }