[PATCH 4/4] xfree86: Check for existence of button class before dereferencing it.

Peter Hutterer peter.hutterer at who-t.net
Tue Aug 31 22:24:06 PDT 2010


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 at who-t.net>
---
 hw/xfree86/common/xf86DGA.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 82fb52a..c468c60 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);
 
-- 
1.7.2.2



More information about the xorg-devel mailing list