summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-03-16 12:50:49 +0100
committerGerd Hoffmann <kraxel@redhat.com>2016-03-24 07:58:20 +0100
commit81b00c968a86250684b49d528a7841c4abe0b1c9 (patch)
tree25334732a1d7eca652a37257b07343dd02f8d3bc
parent0e066b2cc50de4b4d5ef3c9b5a39eddc3f98d060 (diff)
input-linux: fix Coverity warning
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1458129049-12484-1-git-send-email-kraxel@redhat.com
-rw-r--r--ui/input-linux.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 59d93485ec..6ddaa6740f 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;