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
This commit is contained in:
Xaver Hugl 2024-02-14 22:14:56 +01:00 committed by Vlad Zahorodnii
parent 5d787a4083
commit 3a8ae60f87

View file

@ -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<const char *>(map->data), map->size);
const auto mods = QByteArray(static_cast<const char *>(map->data), map->size);
Q_EMIT q->modifiersMap(mods);
}