From: Daniel P. Berrangé Date: Thu, 31 Mar 2022 12:24:14 +0000 (+0100) Subject: hw/char: fix qcode array bounds check in ESCC impl X-Git-Tag: v7.1.0-rc0~129^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9aaf11e7f2b5487b684e900cf164f0aef25f72ab;p=thirdparty%2Fqemu.git hw/char: fix qcode array bounds check in ESCC impl There was an off-by-1 in the qcode conversion array bounds check. Fixes: e709a61a8fe1076a487376fd657544418a38ba06 Reported-by: Peter Maydell Reviewed-by: Peter Maydell Signed-off-by: Daniel P. Berrangé --- diff --git a/hw/char/escc.c b/hw/char/escc.c index 8755d8d34f3..17a908c59b9 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -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; }