hw/char: fix qcode array bounds check in ESCC impl
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 31 Mar 2022 12:24:14 +0000 (13:24 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 26 Apr 2022 15:12:26 +0000 (16:12 +0100)
There was an off-by-1 in the qcode conversion array bounds
check.

Fixes: e709a61a8fe1076a487376fd657544418a38ba06
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
hw/char/escc.c

index 8755d8d34f3f00a09f1edd62f9a8971754ce7fca..17a908c59b91e20c794162d28bf07652c48a8968 100644 (file)
@@ -828,7 +828,7 @@ static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src,
         }
     }
 
-    if (qcode > qemu_input_map_qcode_to_sun_len) {
+    if (qcode >= qemu_input_map_qcode_to_sun_len) {
         return;
     }