From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj084-0005hH-VG for qemu-devel@nongnu.org; Thu, 24 Mar 2016 03:56:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj081-0002d5-Hb for qemu-devel@nongnu.org; Thu, 24 Mar 2016 03:56:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj081-0002aq-Bg for qemu-devel@nongnu.org; Thu, 24 Mar 2016 03:56:25 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 2D1077F0A7 for ; Thu, 24 Mar 2016 07:56:23 +0000 (UTC) From: Gerd Hoffmann Date: Thu, 24 Mar 2016 08:56:17 +0100 Message-Id: <1458806178-31096-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1458806178-31096-1-git-send-email-kraxel@redhat.com> References: <1458806178-31096-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/3] input-linux: fix Coverity warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Message-id: 1458129049-12484-1-git-send-email-kraxel@redhat.com --- ui/input-linux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/input-linux.c b/ui/input-linux.c index 59d9348..6ddaa67 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -213,6 +213,13 @@ static void input_linux_event_keyboard(void *opaque) */ continue; } + if (event.code >= KEY_CNT) { + /* + * Should not happen. But better safe than sorry, + * and we make Coverity happy too. + */ + continue; + } /* keep track of key state */ if (!il->keydown[event.code] && event.value) { il->keydown[event.code] = true; -- 1.8.3.1