[gtk+] Missing NULL-check in XI2's implementation for get_window()

commit 201410de60405148a8ae1e0bad568a9879fc06a8
Author: Mario Sanchez Prada <mario prada samsung com>
Date:   Thu May 16 15:34:05 2013 +0100

    Missing NULL-check in XI2's implementation for get_window()
    Add missing check in gdk_x11_device_manager_xi2_get_window(), returning
    NULL if no valid XI2Event* has been found. Calling code seems to be
    prepared to handle NULLs coming from this function, so it should be
    safe enough (e.g. check gdk_event_source_get_filter_window()).

 gdk/x11/gdkdevicemanager-xi2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 751343a..b9093b9 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1682,6 +1682,8 @@ gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator,
     return NULL;
   ev = (XIEvent *) xevent->xcookie.data;
+  if (!ev)
+    return NULL;
   get_event_window (translator, ev, &window);
   return window;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]