core: event_processor: Add missing break in list iteration 10/129510/1
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Tue, 16 May 2017 17:08:13 +0000 (19:08 +0200)
committerKrzysztof Opasiak <k.opasiak@samsung.com>
Tue, 16 May 2017 20:48:54 +0000 (22:48 +0200)
When we find handler for particular event we should stop list
iteration. Otherwise we may get a NULL pointer dereference.

Change-Id: I33022ea84d8e9e5b0a71cf53f9ad4adb006afb3e
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
src/core/event_processor.c

index 7fcf8af9ad2ca1fd9b29c5d73ab6857bcfab21e5..520055c7a2483de32acb2f080a2a2bd7067177b5 100644 (file)
@@ -52,6 +52,7 @@ static int event_processor_callback(sd_event_source *s,
                if (handler->event_match(handler, ev)) {
                        nqueue_append(&handler->event_queue, &ev->nq_node);
                        ev = NULL;
+                       break;
                }
        }