backends/x11: Prevent segfault when querying list of devices
The XIQueryDevice function used by device_query_area can return a NULL pointer and set n_devices to a negative number in some cases. We add additional checks to prevent a segfault. https://bugzilla.gnome.org/show_bug.cgi?id=787649
This commit is contained in:
parent
4e7405aca9
commit
8493777961
@ -589,7 +589,7 @@ device_query_area (ClutterInputDevice *device,
|
||||
*width = *height = 0;
|
||||
device_id = clutter_input_device_get_device_id (device);
|
||||
info = XIQueryDevice (xdisplay, device_id, &n_devices);
|
||||
if (n_devices == 0)
|
||||
if (n_devices <= 0 || !info)
|
||||
return FALSE;
|
||||
|
||||
abs_x = XInternAtom (xdisplay, "Abs X", True);
|
||||
|
Loading…
Reference in New Issue
Block a user