From 91ef4ce2081fec77d060ce2e9879535697e23b91 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 21 May 2026 13:35:48 +0200 Subject: [PATCH] virtual_keyboard_v1: validate keymap format --- protocol/virtual-keyboard-unstable-v1.xml | 1 + types/wlr_virtual_keyboard_v1.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/protocol/virtual-keyboard-unstable-v1.xml b/protocol/virtual-keyboard-unstable-v1.xml index d9c8464ca..a888e5f87 100644 --- a/protocol/virtual-keyboard-unstable-v1.xml +++ b/protocol/virtual-keyboard-unstable-v1.xml @@ -47,6 +47,7 @@ + diff --git a/types/wlr_virtual_keyboard_v1.c b/types/wlr_virtual_keyboard_v1.c index 465b97dd3..03838cff3 100644 --- a/types/wlr_virtual_keyboard_v1.c +++ b/types/wlr_virtual_keyboard_v1.c @@ -44,6 +44,13 @@ static void virtual_keyboard_keymap(struct wl_client *client, return; } + if (!wl_keyboard_keymap_format_is_valid(format, 1)) { + wl_resource_post_error(resource, + ZWP_VIRTUAL_KEYBOARD_V1_ERROR_INVALID_KEYMAP_FORMAT, + "Invalid keymap format"); + return; + } + struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!context) { goto context_fail;