diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-09-23 12:43:31 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-09-23 12:43:31 +0300 |
commit | 0e800ca4651a947ccef239e6fe7bf64aab92257c (patch) | |
tree | 8d03da81dde08849cdab59bea91cdb5f8e5f2fa0 /dix | |
parent | e1860f241b7322c54c109cf5727df45b54b73916 (diff) |
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.
Diffstat (limited to 'dix')
-rw-r--r-- | dix/getevents.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 |