aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/xiselectev.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-08 21:42:21 +0000
committermarha <marha@users.sourceforge.net>2011-01-08 21:42:21 +0000
commitee97a3165b1f07f011cf95804590925b81e8ec96 (patch)
tree58aa78664ad871145a5a0149f9ad60f140f934aa /xorg-server/Xi/xiselectev.c
parentc8a34ce9318446bcd8e91e601525a61d6847f28f (diff)
parent432768f75da13ee5343957df6ce5cd316a62929f (diff)
downloadvcxsrv-ee97a3165b1f07f011cf95804590925b81e8ec96.tar.gz
vcxsrv-ee97a3165b1f07f011cf95804590925b81e8ec96.tar.bz2
vcxsrv-ee97a3165b1f07f011cf95804590925b81e8ec96.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/Xi/xiselectev.c')
-rw-r--r--xorg-server/Xi/xiselectev.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/xorg-server/Xi/xiselectev.c b/xorg-server/Xi/xiselectev.c
index 6a810bce4..6f26b3d08 100644
--- a/xorg-server/Xi/xiselectev.c
+++ b/xorg-server/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;