Commit 4282c827 authored by Don Koch's avatar Don Koch Committed by Michael Tokarev
Browse files

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: default avatarDon Koch <dkoch@verizon.com>
Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
parent efbc42e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
    }
}