summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-08-23 08:35:01 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-09-27 09:41:47 +0200
commit918cb214ab4240be4772a141d1209c0ff5dfd63b (patch)
tree00af006931e6900948883b15c6fbc479c8dd6d45
parent5a29cb126de577a2a0a41e10d9af13091a73d334 (diff)
xfree86: Check for existence of button class before dereferencing it.
The Irxon Super Mini Bluetooth Wireless Keyboard for PC/PDA/Cell Phones keyboards have axes but not buttons. The evdev driver doesn't set up a button class for these keyboards and a motion event handled by DGAProcessPointerEvent dereferences the dev->button NULL pointer, causing a server crash. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> (cherry picked from commit e00e2e7b68fbc932269d607ac5dc2c441d07ad9d)
-rw-r--r--hw/xfree86/common/xf86DGA.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 82fb52a05..c468c6038 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -1095,7 +1095,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse)
ev.header = ET_Internal;
ev.length = sizeof(ev);
ev.type = event->subtype;
- ev.corestate = butc->state;
+ ev.corestate = butc ? butc->state : 0;
if (master && master->key)
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);