From 5d575b700e17ca153b2ded389f98f6ec8ca65491 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 4 Jan 2009 18:19:46 +0000 Subject: [PATCH] mi: Fix segv on CopyKeyClass (#19222) X.Org Bug 19222 Signed-off-by: Peter Hutterer --- mi/mieq.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mi/mieq.c b/mi/mieq.c index a15ba7b..b7392a1 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -362,14 +362,15 @@ mieqProcessInputEvents(void) NewCurrentScreen (dev, DequeueScreen(dev), x, y); } else { - /* Force a copy of the key class into the VCK so that the layout - is transferred. */ - if (event->u.u.type == DeviceKeyPress || - event->u.u.type == DeviceKeyRelease) - CopyKeyClass(dev, master); + if (master) { + /* Force a copy of the key class into the VCK so that the layout + is transferred. */ + if (event->u.u.type == DeviceKeyPress || + event->u.u.type == DeviceKeyRelease) + CopyKeyClass(dev, master); - if (master) CopyGetMasterEvent(master, event, masterEvents, nevents); + } /* If someone's registered a custom event handler, let them * steal it. */ -- 1.6.0.6