[waffle] [PATCH 1/2] wayland: add a handler for global remove event

Rob Bradford robert.bradford at intel.com
Tue Jan 7 10:55:13 PST 2014


From: Rob Bradford <rob at linux.intel.com>

The Wayland event dispatch infrastructure does not check if the event
handler member is NULL before dereferencing the appropriate member in
the listener.

This change supplies an empty function as the event handler for the
global remove event on the wl_registry listener rather than the
previously supplied NULL value.

Signed-off-by: Rob Bradford <rob at linux.intel.com>
---
 src/waffle/wayland/wayland_display.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/waffle/wayland/wayland_display.c b/src/waffle/wayland/wayland_display.c
index ec9d336..e7c6e94 100644
--- a/src/waffle/wayland/wayland_display.c
+++ b/src/waffle/wayland/wayland_display.c
@@ -76,9 +76,16 @@ registry_listener_global(void *data,
     }
 }
 
+static void
+registry_listener_global_remove(void *data,
+                                struct wl_registry *registry,
+                                uint32_t name)
+{
+}
+
 static const struct wl_registry_listener registry_listener = {
     .global = registry_listener_global,
-    .global_remove = NULL,
+    .global_remove = registry_listener_global_remove
 };
 
 struct wcore_display*
-- 
1.8.3.1



More information about the waffle mailing list