From: Don Koch Date: Tue, 19 Nov 2013 20:01:59 +0000 (-0500) Subject: Don't crash on keyboard input with no handler X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4282c8277013dc5613b8f27845f6121b66b7cbff;p=qemu.git Don't crash on keyboard input with no handler Prevent a call to put_kbd if null. On shutdown of some OSes, the keyboard handler goes away before the system is down. If a key is typed during this window, qemu crashes. Signed-off-by: Don Koch Signed-off-by: Michael Tokarev --- diff --git a/ui/input.c b/ui/input.c index 10d8c056f1..1c70f60e0d 100644 --- a/ui/input.c +++ b/ui/input.c @@ -414,7 +414,7 @@ void kbd_put_keycode(int keycode) if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) { return; } - if (entry) { + if (entry && entry->put_kbd) { entry->put_kbd(entry->opaque, keycode); } }