mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-05 22:48:04 +02:00
Fix a crash when requesting invalid mode group indices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
67a7026b74
commit
c787ccf270
1 changed files with 4 additions and 0 deletions
|
|
@ -645,5 +645,9 @@ evdev_device_tablet_pad_get_mode_group(struct evdev_device *device,
|
||||||
if (!(device->seat_caps & EVDEV_DEVICE_TABLET_PAD))
|
if (!(device->seat_caps & EVDEV_DEVICE_TABLET_PAD))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (index >=
|
||||||
|
(unsigned int)evdev_device_tablet_pad_get_num_mode_groups(device))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return pad_get_mode_group(pad, index);
|
return pad_get_mode_group(pad, index);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue