OSDN Git Service

qemu-keymap: properly check return from xkb_keymap_mod_get_index
authorAlex Bennée <alex.bennee@linaro.org>
Fri, 30 Jun 2023 18:03:51 +0000 (19:03 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 3 Jul 2023 11:51:21 +0000 (12:51 +0100)
commit58127176589c22d9fb8d60b67ce2c9bbec3dca67
treef147542be7fcaf1c90821060b79599e70593db87
parentaf323aabe2a7152b1e857baa840485b79c06bbf1
qemu-keymap: properly check return from xkb_keymap_mod_get_index

We can return XKB_MOD_INVALID for AltGr which rightly gets flagged by
sanitisers as an overly wide shift attempt. Properly check the return
type and leave the bitmap as zero in that case. Tested output before
and after is unchanged with the gb and ara keymaps.

Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230630180423.558337-7-alex.bennee@linaro.org>
qemu-keymap.c