GNOME Bugzilla – Bug 700465
Missing NULL-check in XI2's implementation for get_window()
Last modified: 2013-05-20 01:21:25 UTC
While working with an cross-compiled version of GTK+3 for an embedded device, I found a crash whenever I tried to paint a GtkWindow bigger than certain values, which lead me to find, using gdb, a missing nullcheck in gdkdevicemanager-xi2.c. I checked carefully the backtrace and the flow that ends up segfaulting in XI2's get_window() (due to a NULL XIEvent in xevent->xcookie.data) starts in _gdk_x11_display_queue_events(), inside gdkeventsource.c, where the code is clearly prepared to deal with NULL values returned from gdk_event_source_translate_event(). So, I believe the issue might be fixed by simply adding the missing NULL-check in gdk_x11_device_manager_xi2_get_window(). At least, that worked wonderfully well for me so far.
Created attachment 244416 [details] [review] Patch proposal Attaching the patch that fixes the issue
Review of attachment 244416 [details] [review]: Makes sense