From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUuqC-0000Ca-JN for qemu-devel@nongnu.org; Tue, 01 Apr 2014 05:18:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUuq4-0007Ve-F5 for qemu-devel@nongnu.org; Tue, 01 Apr 2014 05:18:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUuq4-0007VY-7X for qemu-devel@nongnu.org; Tue, 01 Apr 2014 05:18:36 -0400 From: Gerd Hoffmann Date: Tue, 1 Apr 2014 11:18:27 +0200 Message-Id: <1396343907-31756-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1396343907-31756-1-git-send-email-kraxel@redhat.com> References: <1396343907-31756-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 3/3] input: add sanity check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori Check we've actually found a input handler before trying to call it. Signed-off-by: Gerd Hoffmann --- 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