qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] input-linux: fix Coverity warning
@ 2016-03-16 11:50 Gerd Hoffmann
  2016-03-16 12:03 ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2016-03-16 11:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <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 76a2abb..f884c00 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -257,6 +257,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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-16 12:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-16 11:50 [Qemu-devel] [PATCH] input-linux: fix Coverity warning Gerd Hoffmann
2016-03-16 12:03 ` Stefan Weil
2016-03-16 12:35   ` Gerd Hoffmann

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).