mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
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:
parent
76721e736e
commit
7b40fdbc21
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user