From af170a4ab76d33254dd4e54a33bb410fa1624739 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 --- Xext/xtest.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Xext') diff --git a/Xext/xtest.c b/Xext/xtest.c index a1aacc4cd..99b6711f2 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) @@ -388,6 +389,8 @@ ProcXTestFakeInput(ClientPtr client) client->errorValue = ev->u.u.detail; return BadValue; } + + need_ptr_update = 0; break; case MotionNotify: if (!dev->valuator) @@ -452,7 +455,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