* [PATCH] hw/char: fix qcode array bounds check in ESCC impl
@ 2022-03-31 12:26 Daniel P. Berrangé
  2022-03-31 12:27 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrangé @ 2022-03-31 12:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Marc-André Lureau, Daniel P. Berrangé,
	Paolo Bonzini
There was an off-by-1 in the qcode conversion array bounds
check.
Fixes: e709a61a8fe1076a487376fd657544418a38ba06
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 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.34.1
^ permalink raw reply related	[flat|nested] 2+ messages in thread
* Re: [PATCH] hw/char: fix qcode array bounds check in ESCC impl
  2022-03-31 12:26 [PATCH] hw/char: fix qcode array bounds check in ESCC impl Daniel P. Berrangé
@ 2022-03-31 12:27 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2022-03-31 12:27 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Marc-André Lureau, qemu-devel, Paolo Bonzini
On Thu, 31 Mar 2022 at 13:27, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> There was an off-by-1 in the qcode conversion array bounds
> check.
>
> Fixes: e709a61a8fe1076a487376fd657544418a38ba06
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  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;
>      }
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply	[flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-31 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-31 12:26 [PATCH] hw/char: fix qcode array bounds check in ESCC impl Daniel P. Berrangé
2022-03-31 12:27 ` Peter Maydell
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).