mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-08 19:38:04 +02:00
Xi: start checking for invalid mask bits _after_ LASTEVENT.
Two issues that combined to false positives and false negatives. - The checking for invalid bits must be performed when there are enough bits that an event outside of LASTEVENT may be selected. - The first invalid bit is LASTEVENT + 1, not LASTEVENT. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
e2fbaebb87
commit
9563feeeb5
1 changed files with 2 additions and 2 deletions
|
|
@ -108,10 +108,10 @@ ProcXISelectEvent(ClientPtr client)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((evmask->mask_len * 4) > XI_LASTEVENT)
|
if ((evmask->mask_len * 4) >= (XI_LASTEVENT + 8)/8)
|
||||||
{
|
{
|
||||||
unsigned char *bits = (unsigned char*)&evmask[1];
|
unsigned char *bits = (unsigned char*)&evmask[1];
|
||||||
for (i = XI_LASTEVENT; i < evmask->mask_len * 4; i++)
|
for (i = XI_LASTEVENT + 1; i < evmask->mask_len * 4; i++)
|
||||||
{
|
{
|
||||||
if (BitIsOn(bits, i))
|
if (BitIsOn(bits, i))
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue