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.
This commit is contained in:
parent
e1860f241b
commit
0e800ca465
|
@ -402,6 +402,7 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
|
||||||
if (!events)
|
if (!events)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* DO NOT WANT */
|
||||||
if (type != KeyPress && type != KeyRelease)
|
if (type != KeyPress && type != KeyRelease)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -409,6 +410,9 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
|
||||||
(pDev->coreEvents && !inputInfo.keyboard->key))
|
(pDev->coreEvents && !inputInfo.keyboard->key))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (key_code < 8 || key_code > 255)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (pDev->coreEvents)
|
if (pDev->coreEvents)
|
||||||
numEvents = 2;
|
numEvents = 2;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user