From 91ae2571458c50d9f782190d9f80815b770aefac Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Fri, 26 Feb 2016 16:46:15 +0000 Subject: [PATCH] hw/xwin: Fix a crash which occurs if focus returns to XWin after xkbcomp has failed If WM_FOCUS is received while the "core devices failed" fatal error (due to xkbcomp failing) is displayed, winRestoreModeKeyState() attempts to dereference a NULL InputInfo.keyboard->key pointer. Signed-off-by: Colin Harrison Reviewed-by: Jon Turney --- hw/xwin/winkeybd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index ab53af4ba..00586c25b 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -246,7 +246,7 @@ winRestoreModeKeyStates(void) unsigned short internalKeyStates; /* X server is being initialized */ - if (!inputInfo.keyboard) + if (!inputInfo.keyboard || !inputInfo.keyboard->key) return; /* Only process events if the rootwindow is mapped. The keyboard events