Commit 5c361d59 authored by Chase Douglas's avatar Chase Douglas Committed by Peter Hutterer

TouchListenerAcceptReject: Warn and return early on bad listener index

Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
Reviewed-by: Bryce Harrington's avatarBryce Harrington <bryce@canonical.com>
Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 88bacc49
......@@ -966,6 +966,11 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
int nev;
int i;
BUG_WARN(listener < 0);
BUG_WARN(listener >= ti->num_listeners);
if (listener < 0 || listener >= ti->num_listeners)
return BadMatch;
if (listener > 0) {
if (mode == XIRejectTouch)
TouchRejected(dev, ti, ti->listeners[listener].listener, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment