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
This commit is contained in:
amingin 2019-09-27 12:11:30 +02:00 committed by Simon Ser
parent 5f78ea20fa
commit b1b93c2c7e
1 changed files with 3 additions and 0 deletions

View File

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