[PATCH] TouchListenerAcceptReject: Warn and return early on bad listener index
Peter Hutterer
peter.hutterer at who-t.net
Wed Apr 25 23:05:49 PDT 2012
On Fri, Apr 20, 2012 at 11:08:15AM -0700, Chase Douglas wrote:
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
merged, thanks.
Cheers,
Peter
> ---
> dix/touch.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/dix/touch.c b/dix/touch.c
> index dd16367..401cb98 100644
> --- a/dix/touch.c
> +++ b/dix/touch.c
> @@ -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);
> --
> 1.7.9.1
>
More information about the xorg-devel
mailing list