summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2026-07-06 12:35:38 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2026-07-17 15:52:31 +0400
commit82b4d693d522d406c950067caa4f14f45f4b679e (patch)
treefbf980bcb3e3513460ca29d9adb2c5b53dec7c85 /ui
parent3162692a3b67603e2b01f0c6441daa682acd6164 (diff)
downloadqemu-82b4d693d522d406c950067caa4f14f45f4b679e.tar.gz
qemu-82b4d693d522d406c950067caa4f14f45f4b679e.zip
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/input-barrier.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/input-barrier.c b/ui/input-barrier.c
index d07027114a..0a238d4010 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];
}