Xi: return BadValue for XI_HierarchyChangd mask on devices.

This mask may only be selected for XIAllDevices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-06-08 12:24:24 +10:00
parent 69a9545d1f
commit 0e66a443a0

View File

@ -97,6 +97,13 @@ ProcXISelectEvent(ClientPtr client)
if (rc != Success)
return rc;
/* hierarchy event mask is not allowed on devices */
if (evmask->deviceid != XIAllDevices && evmask->mask_len >= 1)
{
unsigned char *bits = (unsigned char*)&evmask[1];
if (BitIsOn(bits, XI_HierarchyChanged))
return BadValue;
}
if ((evmask->mask_len * 4) > XI_LASTEVENT)
{