[RFC PATCH xf86-input-libinput v2] Do not crash if the device is invalid
Olivier Fourdan
ofourdan at redhat.com
Tue Feb 24 07:12:16 PST 2015
https://bugs.freedesktop.org/show_bug.cgi?id=89296
Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
---
v2: Move the test to LibinputSetProperty() and do it only once
src/libinput.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/libinput.c b/src/libinput.c
index 9613fbd..ac14adb 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -1550,8 +1550,14 @@ static int
LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
BOOL checkonly)
{
+ InputInfoPtr pInfo = dev->public.devicePrivate;
+ struct xf86libinput *driver_data = pInfo->private;
+ struct libinput_device *device = driver_data->device;
int rc;
+ if (device == NULL)
+ return XI_BadDevice;
+
if (atom == prop_tap)
rc = LibinputSetPropertyTap(dev, atom, val, checkonly);
else if (atom == prop_calibration)
--
2.1.0
More information about the xorg-devel
mailing list