Fixes crash of compositor when unvalidated keycode 0 is passed (#1833)

* Fixes crash of compositor when unvalidated keycode 0 is passed from virtual keyboard

* Style fix
master
amingin 5 years ago committed by Simon Ser
parent 5f78ea20fa
commit b1b93c2c7e

@ -75,6 +75,9 @@ context_fail:
static void virtual_keyboard_key(struct wl_client *client, static void virtual_keyboard_key(struct wl_client *client,
struct wl_resource *resource, uint32_t time, uint32_t key, struct wl_resource *resource, uint32_t time, uint32_t key,
uint32_t state) { uint32_t state) {
if (key == 0) {
return;
}
struct wlr_virtual_keyboard_v1 *keyboard = struct wlr_virtual_keyboard_v1 *keyboard =
virtual_keyboard_from_resource(resource); virtual_keyboard_from_resource(resource);
if (!keyboard->has_keymap) { if (!keyboard->has_keymap) {

Loading…
Cancel
Save