]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
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 6e6a92497687fd6b9a0147b46b9850bdcd678b77..1ed0e783b1d676495c44d4d956929ca22cac9a67 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++;
 }