Xi: XIGetSelectedEvents mustn't returned masks from non-existing devices.

Or devices the client doesn't have XACE permissions for.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-06-11 11:08:07 +10:00
parent 7868956b0f
commit 22b4ac44e4

View File

@ -170,6 +170,7 @@ ProcXIGetSelectedEvents(ClientPtr client)
OtherInputMasks *masks;
InputClientsPtr others = NULL;
xXIEventMask *evmask = NULL;
DeviceIntPtr dev;
REQUEST(xXIGetSelectedEventsReq);
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
@ -211,6 +212,14 @@ ProcXIGetSelectedEvents(ClientPtr client)
int j;
unsigned char *devmask = others->xi2mask[i];
if (i > 2)
{
rc = dixLookupDevice(&dev, i, client, DixReadAccess);
if (rc != Success)
continue;
}
for (j = XI2MASKSIZE - 1; j >= 0; j--)
{
if (devmask[j] != 0)