Avahi disables a timer by tv=NULL in avahi_timeout_update(), do not crash
authorVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2009 09:03:59 +0000 (10:03 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2009 09:05:27 +0000 (10:05 +0100)
source3/lib/avahi.c

index ac9867a1fcea7e695db185c94633c7e0040b1a8d..269b329e640695bdf416c3b0acbdba7469dc8977 100644 (file)
@@ -207,6 +207,13 @@ static void avahi_timeout_update(AvahiTimeout *t, const struct timeval *tv)
 {
        TALLOC_FREE(t->te);
 
+       if (tv == NULL) {
+               /*
+                * Disable this timer
+                */
+               return;
+       }
+
        t->te = tevent_add_timer(t->ctx->ev, t, *tv, avahi_timeout_handler, t);
        /*
         * No failure mode defined here