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.
(cherry picked from commit 0e800ca465
)
This commit is contained in:
parent
35bf7c738a
commit
f3a5d67688
|
@ -409,6 +409,7 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
|
|||
if (!events)
|
||||
return 0;
|
||||
|
||||
/* DO NOT WANT */
|
||||
if (type != KeyPress && type != KeyRelease)
|
||||
return 0;
|
||||
|
||||
|
@ -416,6 +417,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
|
||||
|
|
Loading…
Reference in New Issue
Block a user