@samitouri / QOSamiQemu / commits / 82b4d693d5

ui/input-barrier: fix off-by-one in keycode bounds check

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 Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Marc-Andre Lureau <marcandre.lureau@redhat.com>

Marc-André Lureau committed Jul 6, 2026 at 12:35 UTC 82b4d693d522d406c950067caa4f14f45f4b679e
1 file changed +1 -1
ui/input-barrier.c
+1 -1
@@ -87,7 +87,7 @@ static kbd_layout_t *kbd_layout;
87 static unsigned int input_barrier_to_linux(uint16_t keyid, uint16_t keycode)
88 {
89 /* keycode is optional, if it is not provided use keyid */
90 - if (keycode && keycode <= qemu_input_map_xorgkbd_to_linux_len) {
90 + if (keycode && keycode < qemu_input_map_xorgkbd_to_linux_len) {
91 return qemu_input_map_xorgkbd_to_linux[keycode];
92 }
93