From fdce58ca822f4e43e03e84076190f52d7104e01f 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 83285b4d1..dc5de0526 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -226,6 +226,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;