aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDon Koch <dkoch@verizon.com>2013-11-19 15:01:59 -0500
committerMichael Tokarev <mjt@tls.msk.ru>2013-12-02 21:09:04 +0400
commit4282c8277013dc5613b8f27845f6121b66b7cbff (patch)
treee4b69091cfe8360c38aa42efcc050b1654b08750 /ui
parentefbc42e5848bb8000bfa6927847f1870850942ba (diff)
downloadqemu-4282c8277013dc5613b8f27845f6121b66b7cbff.zip
qemu-4282c8277013dc5613b8f27845f6121b66b7cbff.tar.gz
qemu-4282c8277013dc5613b8f27845f6121b66b7cbff.tar.bz2
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 <dkoch@verizon.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'ui')
-rw-r--r--ui/input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/input.c b/ui/input.c
index 10d8c05..1c70f60 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);
}
}