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

Hans de Goede hdegoede at redhat.com
Wed Apr 8 02:44:15 PDT 2015


Hi,

On 08-04-15 01:54, Peter Hutterer wrote:
> 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>

Entire series looks good, I've added my Rev-by and pushed this.

Regards,

Hans

> ---
>   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));
>   }
>
>


More information about the wayland-devel mailing list