On 7/6/26 14:53, Marc-André Lureau wrote:
Use strict "<" to fix the off-by-one.Fixes: 6105683da35b ("ui: add an embedded Barrier client") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3951 Reported-by: huntr bubble Signed-off-by: Marc-Andre Lureau <[email protected]> --- ui/input-barrier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/input-barrier.c b/ui/input-barrier.c index d07027114af..0a238d4010b 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -87,7 +87,7 @@ static kbd_layout_t *kbd_layout; static unsigned int input_barrier_to_linux(uint16_t keyid, uint16_t keycode) { /* keycode is optional, if it is not provided use keyid */ - if (keycode && keycode <= qemu_input_map_xorgkbd_to_linux_len) { + if (keycode && keycode < qemu_input_map_xorgkbd_to_linux_len) { return qemu_input_map_xorgkbd_to_linux[keycode]; }
Reviewed-by: Laurent Vivier <[email protected]>
