mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-25 12:49:21 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user