ui/input-barrier: fix off-by-one in keycode bounds check
Use strict "<" to fix the off-by-one.
Fixes: 6105683da3 ("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>
This commit is contained in:
1 parent
3162692a3b
commit
82b4d693d5
1 file changed
+1
-1
+1
-1
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user