hw/char: fix qcode array bounds check in ESCC impl
PATCH 1/1 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 <[email protected]>
Signed-off-by Daniel P. Berrangé <[email protected]>
--- hw/char/escc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/char/escc.c +1 -1
@@ -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 ; }
Signature · 1 line
2.34.1
Quoted 16 lines · Daniel P. Berrangé
There was an off-by-1 in the qcode conversion array bounds check.
Fixes e709a61a8fe1076a487376fd657544418a38ba06Reported-by Peter Maydell <[email protected]>Signed-off-by Daniel P. Berrangé <[email protected]>--- hw/char/escc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/char/escc.c +0
-0
hw/char/escc.c static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src, · line 833
Quoted 7 lines
hw/char/escc.c +1
-1@@ -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 ; }
Reviewed-by Peter Maydell <[email protected]>
thanks
-- PMM