From b1b93c2c7e6cc9d804390c740c2a199814e8e5ba Mon Sep 17 00:00:00 2001 From: amingin Date: Fri, 27 Sep 2019 12:11:30 +0200 Subject: 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 --- types/wlr_virtual_keyboard_v1.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/wlr_virtual_keyboard_v1.c b/types/wlr_virtual_keyboard_v1.c index fd0d7797..ddd38880 100644 --- a/types/wlr_virtual_keyboard_v1.c +++ b/types/wlr_virtual_keyboard_v1.c @@ -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) { -- cgit v1.2.3