From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agrca-0001nS-ER for qemu-devel@nongnu.org; Fri, 18 Mar 2016 06:27:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agrcU-0007rn-K7 for qemu-devel@nongnu.org; Fri, 18 Mar 2016 06:27:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agrcU-0007kL-F2 for qemu-devel@nongnu.org; Fri, 18 Mar 2016 06:27:02 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id B8D52C00124A for ; Fri, 18 Mar 2016 10:26:39 +0000 (UTC) From: Gerd Hoffmann Date: Fri, 18 Mar 2016 11:26:32 +0100 Message-Id: <1458296795-29995-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1458296795-29995-1-git-send-email-kraxel@redhat.com> References: <1458296795-29995-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/5] 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