summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2008-07-08 16:02:13 +0930
committerPeter Hutterer <peter.hutterer@who-t.net>2008-07-10 16:02:55 +0930
commitacce27093571497a0626cee1cdb61ddf751dbc40 (patch)
tree82676a6dd2f5a03939cec42bf607b5bff9ae4109 /dix
parentdb86b8839f286e0e2efb5638b8ab2fe608707655 (diff)
Xext: store the GenericMasks in the resource system.
This fixes a severe issue - when the client died the event mask didn't get unregistered and a future event would dereference dangling pointers. By storing the event masks in the resource system we can free them when the client dies.
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/dix/events.c b/dix/events.c
index a4deaaa08..692d02fc2 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2118,7 +2118,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
/* Handle generic events */
if (type == GenericEvent)
{
- GenericMaskPtr pClient;
+ GenericMaskPtr gmask;
/* We don't do more than one GenericEvent at a time. */
if (count > 1)
{
@@ -2132,16 +2132,16 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
return 0;
/* run through all clients, deliver event */
- for (pClient = GECLIENT(pWin); pClient; pClient = pClient->next)
+ for (gmask = GECLIENT(pWin); gmask; gmask = gmask->next)
{
- if (pClient->eventMask[GEEXTIDX(pEvents)] & filter)
+ if (gmask->eventMask[GEEXTIDX(pEvents)] & filter)
{
- if (XaceHook(XACE_RECEIVE_ACCESS, pClient->client, pWin,
+ if (XaceHook(XACE_RECEIVE_ACCESS, rClient(gmask), pWin,
pEvents, count))
/* do nothing */;
- else if (TryClientEvents(pClient->client, pDev,
+ else if (TryClientEvents(rClient(gmask), pDev,
pEvents, count,
- pClient->eventMask[GEEXTIDX(pEvents)],
+ gmask->eventMask[GEEXTIDX(pEvents)],
filter, grab) > 0)
{
deliveries++;
@@ -2223,7 +2223,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
{
GenericClientMasksPtr gemasks = pWin->optional->geMasks;
GenericMaskPtr geclient = gemasks->geClients;
- while(geclient && geclient->client != client)
+ while(geclient && rClient(geclient) != client)
geclient = geclient->next;
if (geclient)
{