Fix UB in TaggedString constructor (#3748)

This commit is contained in:
Bart Louwers
2025-08-26 14:50:43 +02:00
committed by GitHub
parent ec8a7a49fb
commit 77c251bd1d

View File

@@ -72,8 +72,9 @@ struct SectionOptions {
struct TaggedString {
TaggedString() = default;
TaggedString(std::u16string text_, SectionOptions options)
: styledText(std::move(text_), std::vector<uint8_t>(text_.size(), 0)) {
TaggedString(std::u16string text_, SectionOptions options) {
auto size = text_.size();
styledText = {std::move(text_), std::vector<uint8_t>(size, 0)};
sections.push_back(std::move(options));
}