summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-04-21 15:51:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-05-04 10:54:38 +1000
commitad48184752970541aa153bf2961a2d7da1a910b5 (patch)
tree6a3160800b7f367309d0bf2a3c22f93e15d5a2e6
parentd2229e829d61033141d25fd4486c689c0367b97e (diff)
Xext: only update the sprite on pointer events.
A call to miPointerUpdateSprite for the XTEST keyboard may result in a NULL pointer dereference in miDCPutUpCursor() when the save buffer is NULL. XTS test case: Xlib 11 KeymapNotify Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit af170a4ab76d33254dd4e54a33bb410fa1624739)
-rw-r--r--Xext/xtest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 6b0e9fd14..e6d4431a4 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -184,6 +184,7 @@ ProcXTestFakeInput(ClientPtr client)
int i;
int base = 0;
int flags = 0;
+ int need_ptr_update = 1;
nev = (stuff->length << 2) - sizeof(xReq);
if ((nev % sizeof(xEvent)) || !nev)
@@ -387,6 +388,8 @@ ProcXTestFakeInput(ClientPtr client)
client->errorValue = ev->u.u.detail;
return BadValue;
}
+
+ need_ptr_update = 0;
break;
case MotionNotify:
if (!dev->valuator)
@@ -451,7 +454,8 @@ ProcXTestFakeInput(ClientPtr client)
for (i = 0; i < nevents; i++)
mieqProcessDeviceEvent(dev, (InternalEvent*)(xtest_evlist+i)->event, NULL);
- miPointerUpdateSprite(dev);
+ if (need_ptr_update)
+ miPointerUpdateSprite(dev);
return client->noClientException;
}