qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL 3/3] input: add sanity check
Date: Tue,  1 Apr 2014 11:18:27 +0200	[thread overview]
Message-ID: <1396343907-31756-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1396343907-31756-1-git-send-email-kraxel@redhat.com>

Check we've actually found a input handler before trying to call it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/input.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ui/input.c b/ui/input.c
index 6e6a924..1ed0e78 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -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++;
 }
-- 
1.8.3.1

  parent reply	other threads:[~2014-04-01  9:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01  9:18 [Qemu-devel] [PULL for-2.0 0/3] input bugfixes Gerd Hoffmann
2014-04-01  9:18 ` [Qemu-devel] [PULL 1/3] input: fix input_event_key_number trace event Gerd Hoffmann
2014-04-01  9:18 ` [Qemu-devel] [PULL 2/3] input: mouse_set should check input device type Gerd Hoffmann
2014-04-01  9:18 ` Gerd Hoffmann [this message]
2014-04-01 17:15 ` [Qemu-devel] [PULL for-2.0 0/3] input bugfixes Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396343907-31756-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).