diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2013-11-20 17:21:28 +0000 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2016-08-07 08:17:50 +0100 |
commit | 7b40fdbc2109ed40faff051bcf2c323ffb280741 (patch) | |
tree | a4dd7ca5b717a83d62be251d3e5d99df51ebeafd | |
parent | 76721e736e9605b3a7ec76d3676d8cb5f4172490 (diff) | |
download | gtk+-7b40fdbc2109ed40faff051bcf2c323ffb280741.tar.gz |
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
-rw-r--r-- | gdk/gdkwindow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index aa28e4aa95..186478bc9e 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -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) |