touchpad: fix the libwacom_is_reversible() check on the paired device

dev was already freed, the device we want to check here is d so
technically this is a UAF bug. Fortunately for us, this condition was
never triggered - none of the current devices in libwacom that have a
PairedID setting are also touchpads (they're all display tablets).

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1481>
This commit is contained in:
Peter Hutterer 2026-05-26 10:49:38 +10:00
parent 31658a34ff
commit 649d65dbba

View file

@ -3953,7 +3953,7 @@ tp_requires_rotation(struct tp_dispatch *tp, struct evdev_device *device)
paired = libwacom_get_paired_device(*d);
if (paired && libwacom_match_get_vendor_id(paired) == vid &&
libwacom_match_get_product_id(paired) == pid) {
rotate = libwacom_is_reversible(dev);
rotate = libwacom_is_reversible(*d);
break;
}
d++;