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 <peter.hutterer@who-t.net>
(cherry picked from commit 6f9e220498)

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Peter Hutterer 2009-05-11 12:51:40 +10:00 committed by Keith Packard
parent bd94c7c986
commit c91accd173

View file

@ -216,6 +216,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;