[PATCH libinput 1/5] evdev: fix crash for missing ABS_X/Y

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 7 16:54:29 PDT 2015


libevdev_set_abs_info() is a noop if the event code isn't enabled on the
device. This leaves ABS_X/Y on NULL, causing a crash later when dereferencing
the absinfo.

https://bugs.freedesktop.org/show_bug.cgi?id=89783

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index a972b9d..115dc99 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1444,9 +1444,9 @@ evdev_fix_android_mt(struct evdev_device *device)
 	    !libevdev_has_event_code(evdev, EV_ABS, ABS_MT_POSITION_Y))
 		return;
 
-	libevdev_set_abs_info(evdev, ABS_X,
+	libevdev_enable_event_code(evdev, EV_ABS, ABS_X,
 		      libevdev_get_abs_info(evdev, ABS_MT_POSITION_X));
-	libevdev_set_abs_info(evdev, ABS_Y,
+	libevdev_enable_event_code(evdev, EV_ABS, ABS_Y,
 		      libevdev_get_abs_info(evdev, ABS_MT_POSITION_Y));
 }
 
-- 
2.3.4



More information about the wayland-devel mailing list