From 0e800ca4651a947ccef239e6fe7bf64aab92257c Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sun, 23 Sep 2007 12:43:31 +0300 Subject: GetKeyboardEvents: Reject out-of-range keycodes (bug #12528) We can only deal with keycodes between 8 and 255, so make sure that we never accept anything out of this range. --- dix/getevents.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dix') diff --git a/dix/getevents.c b/dix/getevents.c index 738bd361f..a6e246ac7 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -402,6 +402,7 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, if (!events) return 0; + /* DO NOT WANT */ if (type != KeyPress && type != KeyRelease) return 0; @@ -409,6 +410,9 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, (pDev->coreEvents && !inputInfo.keyboard->key)) return 0; + if (key_code < 8 || key_code > 255) + return 0; + if (pDev->coreEvents) numEvents = 2; else -- cgit v1.2.3