diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-11-05 13:32:59 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-11-05 13:32:59 +0000 |
commit | bf781c5ff285301ad70ffc5f4321b8906f71edd8 (patch) | |
tree | 3b770f4bf9a8cd11dd9f14e7f758991a73a52d78 /xserver/Xi/xiselectev.c | |
parent | e59d0622d3162f7b5a7420ef87dbebb200348c37 (diff) |
Update to xserver 1.11.2
Diffstat (limited to 'xserver/Xi/xiselectev.c')
-rw-r--r-- | xserver/Xi/xiselectev.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/xserver/Xi/xiselectev.c b/xserver/Xi/xiselectev.c index 7aa3f0ab6..22fbaf5e7 100644 --- a/xserver/Xi/xiselectev.c +++ b/xserver/Xi/xiselectev.c @@ -42,14 +42,19 @@ * * @return BadValue if at least one invalid bit is set or Success otherwise. */ -int XICheckInvalidMaskBits(unsigned char *mask, int len) +int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len) { if (len >= XIMaskLen(XI2LASTEVENT)) { int i; for (i = XI2LASTEVENT + 1; i < len * 8; i++) + { if (BitIsOn(mask, i)) + { + client->errorValue = i; return BadValue; + } + } } return Success; @@ -126,7 +131,10 @@ ProcXISelectEvents(ClientPtr client) { unsigned char *bits = (unsigned char*)&evmask[1]; if (BitIsOn(bits, XI_HierarchyChanged)) + { + client->errorValue = XI_HierarchyChanged; return BadValue; + } } /* Raw events may only be selected on root windows */ @@ -138,10 +146,13 @@ ProcXISelectEvents(ClientPtr client) BitIsOn(bits, XI_RawButtonPress) || BitIsOn(bits, XI_RawButtonRelease) || BitIsOn(bits, XI_RawMotion)) + { + client->errorValue = XI_RawKeyPress; return BadValue; + } } - if (XICheckInvalidMaskBits((unsigned char*)&evmask[1], + if (XICheckInvalidMaskBits(client, (unsigned char*)&evmask[1], evmask->mask_len * 4) != Success) return BadValue; |