summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-06-11 11:08:07 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-06-11 13:42:49 +1000
commit22b4ac44e4fdbe8f36f2b570cdbdaf237062e33e (patch)
treef87224c784ee27ec76d6a45e5a8c85fd93f1de49
parent7868956b0fb50a9d77506f01413612e429f540a3 (diff)
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>
-rw-r--r--Xi/xiselectev.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c
index 74e444be6..cafb97641 100644
--- a/Xi/xiselectev.c
+++ b/Xi/xiselectev.c
@@ -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)