OSDN Git Service

input: add sanity check
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 31 Mar 2014 14:07:30 +0000 (16:07 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 1 Apr 2014 08:17:45 +0000 (10:17 +0200)
Check we've actually found a input handler before trying to call it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/input.c

index 6e6a924..1ed0e78 100644 (file)
@@ -143,6 +143,9 @@ void qemu_input_event_send(QemuConsole *src, InputEvent *evt)
 
     /* send event */
     s = qemu_input_find_handler(1 << evt->kind);
+    if (!s) {
+        return;
+    }
     s->handler->event(s->dev, src, evt);
     s->events++;
 }