From ad48184752970541aa153bf2961a2d7da1a910b5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 21 Apr 2010 15:51:20 +1000 Subject: 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 (cherry picked from commit af170a4ab76d33254dd4e54a33bb410fa1624739) --- Xext/xtest.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3