[PATCH] xfree86: dga needs to the master keyboard state (#27573)

Peter Hutterer peter.hutterer at who-t.net
Thu Apr 15 23:35:22 PDT 2010


GetPairedDevice() may not always return the keyboard, resulting in a
null-pointer derefernce when accessing the XKB state.

X.Org Bug 27573 <http://bugs.freedesktop.org/show_bug.cgi?id=27573>

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 804fd37..faa1cd0 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -1094,7 +1094,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse)
     ev.length = sizeof(ev);
     ev.type = event->subtype;
     ev.corestate  = butc->state;
-    ev.corestate |= XkbStateFieldFromRec(&GetPairedDevice(mouse)->key->xkbInfo->state);
+    ev.corestate |= XkbStateFieldFromRec(&GetMaster(mouse, MASTER_KEYBOARD)->key->xkbInfo->state);
 
     UpdateDeviceState(mouse, &ev);
 
-- 
1.6.6.1


More information about the xorg-devel mailing list