Skip to contentSkip to conversation

Don't crash on keyboard input with no handler

PATCH Applied Don Koch 2 participants 2 messages Nov 19, 2013 – Dec 2, 2013

lore
Share & tools
lore

Don Koch

author
#0 lore raw

PATCH v2 1/1 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.

---
v2: punt printf()

 ui/input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/input.c +1 -1
index 10d8c05..1c70f60 100644
@@ -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);
     }
 }
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 4 lines · Don Koch

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.

Thanks, applied to the trivial patches queue.

/mjt