summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2023-07-03 13:30:24 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-07-03 13:33:19 +1000
commit310db4206f2d2fc793e3044ee9886a20cc14ee86 (patch)
treed1e9032466cb9fecb46f00c91b69018dade89d1a
parent94a52a848801ff035ec4d1c604dac7c90708e562 (diff)
Don't run past the last element in the list
If there is no (other) libinput device in the current device list, we'd eventually end up with next == NULL, causing a segfault. Fixes #60
-rw-r--r--src/xf86libinput.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index b811ce0..f7a7553 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -1500,7 +1500,7 @@ swap_registered_device(InputInfoPtr pInfo)
return;
next = xf86FirstLocalDevice();
- while (next == pInfo || !is_libinput_device(next))
+ while (next && (next == pInfo || !is_libinput_device(next)))
next = next->next;
input_lock();