From 6f9e22049862ee9ac7f604411d005d8bb1b2dd1c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 11 May 2009 12:51:40 +1000 Subject: [PATCH] dix: ensure Activate/DeactivateGrab has a valid value. Xephyr doesn't manually set Activate/DeactivateGrab for new devices, resulting in a NULL-pointer dereference later when a grab is activated. Avoid the segfault by ensuring that the pointer is always valid. Signed-off-by: Peter Hutterer --- dix/devices.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dix/devices.c b/dix/devices.c index afe340b2f..6f464e7ca 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -224,6 +224,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) /* device grab defaults */ dev->deviceGrab.grabTime = currentTime; + dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab; + dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab; dev->coreEvents = TRUE;