[Xcb] [PATCH] [event] Zero out handlers list in xcb_event_handlers_init

Mikhail Gusarov dottedmag at dottedmag.net
Fri May 15 12:08:46 PDT 2009


xcb_event_handle relies on the fact that handler for non-handled
event is NULL. Initialize handlers in xcb_event_handlers_init
to avoid calling function by uninitialized pointer.

Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
---
 event/event.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/event/event.c b/event/event.c
index ce83d6e..1332a33 100644
--- a/event/event.c
+++ b/event/event.c
@@ -35,6 +35,7 @@
 void
 xcb_event_handlers_init(xcb_connection_t *c, xcb_event_handlers_t *evenths)
 {
+    memset(evenths, 0, sizeof(xcb_event_handlers_t));
     evenths->c = c;
 }
 
-- 
1.6.3



More information about the Xcb mailing list