summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/evdev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 2d99f07..5cbce35 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -733,6 +733,14 @@ EvdevProcessTouchEvent(InputInfoPtr pInfo, struct input_event *ev)
if (ev->code == ABS_MT_SLOT) {
EvdevProcessTouch(pInfo);
+ if (ev->value >= num_slots(pEvdev) ) {
+ LogMessageVerbSigSafe(X_WARNING, 0,
+ "%s: Slot index %d out of bounds (max %d), touch events may be incorrect.\n",
+ pInfo->name,
+ ev->value,
+ num_slots(pEvdev) - 1);
+ return;
+ }
pEvdev->cur_slot = ev->value;
} else
{