From 308cd236694ac13e2c45293b670b536b63765e62 Mon Sep 17 00:00:00 2001 From: tangbinzy Date: Mon, 4 Sep 2023 07:27:24 +0000 Subject: [PATCH] hw/char: fix qcode array bounds check in ESCC impl mainline inclusion commit 9aaf11e7f2b5487b684e900cf164f0aef25f72ab category: bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --------------------------------------------------------------- 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é Signed-off-by: tangbinzy --- hw/char/escc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/escc.c b/hw/char/escc.c index 8755d8d34f..17a908c59b 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; } -- 2.41.0.windows.1