gdkwindow: Fix potential NULL pointer dereferences in event code

The event code could potentially dereference pointer_info if the
invariant that ENTER_NOTIFY and LEAVE_NOTIFY events are only emitted on
devices which have pointers is violated elsewhere.

Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
This commit is contained in:
Philip Withnall 2013-11-20 17:21:28 +00:00
parent 76721e736e
commit 7b40fdbc21

View File

@ -9935,7 +9935,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
/* We ended up in this window after some (perhaps other clients)
* grab, so update the toplevel_under_window state
*/
if (is_toplevel &&
if (pointer_info && is_toplevel &&
event->type == GDK_ENTER_NOTIFY &&
event->crossing.mode == GDK_CROSSING_UNGRAB)
{
@ -9949,7 +9949,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
}
/* Track toplevel_under_pointer */
if (is_toplevel)
if (pointer_info && is_toplevel)
{
if (event->type == GDK_ENTER_NOTIFY &&
event->crossing.detail != GDK_NOTIFY_INFERIOR)