[gtk+] gdkwindow: Fix potential NULL pointer dereferences in event code
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdkwindow: Fix potential NULL pointer dereferences in event code
- Date: Sun, 7 Aug 2016 07:21:25 +0000 (UTC)
commit 7b40fdbc2109ed40faff051bcf2c323ffb280741
Author: Philip Withnall <philip withnall collabora co uk>
Date: Wed Nov 20 17:21:28 2013 +0000
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
gdk/gdkwindow.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index aa28e4a..186478b 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]