summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-11-30 09:06:06 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-12-09 14:56:24 +1000
commit1ab50be938524dcd4a9e56d27e3b96a27c2db2c0 (patch)
tree5aaa133bb53ec2e6039034805b23bb73c702ea5c
parentd2ebbcdaf6b13d70eee704b1764ff349e1be22a0 (diff)
xfixes: don't dereference a NULL cursor
If the new cursor is the NULL cursor, don't dereference it and use zeros instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--xfixes/cursor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 2950e4579..53f9f202a 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -179,9 +179,9 @@ CursorDisplayCursor (DeviceIntPtr pDev,
ev.type = XFixesEventBase + XFixesCursorNotify;
ev.subtype = XFixesDisplayCursorNotify;
ev.window = e->pWindow->drawable.id;
- ev.cursorSerial = pCursor->serialNumber;
+ ev.cursorSerial = pCursor ? pCursor->serialNumber : 0;
ev.timestamp = currentTime.milliseconds;
- ev.name = pCursor->name;
+ ev.name = pCursor ? pCursor->name : None;
WriteEventsToClient (e->pClient, 1, (xEvent *) &ev);
}
}