From 3a8ae60f87968ba2d16454b331e807b5127bcc85 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Wed, 14 Feb 2024 22:14:56 +0100 Subject: [PATCH] wayland/textinput_v2: copy the data instead of assuming ownership The life time of the wl_array is limited to the callback, afterwards it's a dangling pointer BUG: 481239 --- src/wayland/inputmethod_v1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland/inputmethod_v1.cpp b/src/wayland/inputmethod_v1.cpp index c786827c80..ef82652ac8 100644 --- a/src/wayland/inputmethod_v1.cpp +++ b/src/wayland/inputmethod_v1.cpp @@ -110,7 +110,7 @@ public: } void zwp_input_method_context_v1_modifiers_map(Resource *, wl_array *map) override { - const auto mods = QByteArray::fromRawData(static_cast(map->data), map->size); + const auto mods = QByteArray(static_cast(map->data), map->size); Q_EMIT q->modifiersMap(mods); }