Skip to content

Commit 5542c04

Browse files
committed
Fix stack-use-after-scope in ParagraphTest.GetWordBoundaryParagraph
1 parent 9474594 commit 5542c04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

third_party/txt/src/txt/paragraph_txt.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,8 @@ Paragraph::Range<size_t> ParagraphTxt::GetWordBoundary(size_t offset) {
19921992
return Range<size_t>(0, 0);
19931993
}
19941994

1995-
word_breaker_->setText(icu::UnicodeString(false, text_.data(), text_.size()));
1995+
auto unicode_text = icu::UnicodeString(false, text_.data(), text_.size());
1996+
word_breaker_->setText(unicode_text);
19961997

19971998
int32_t prev_boundary = word_breaker_->preceding(offset + 1);
19981999
int32_t next_boundary = word_breaker_->next();

0 commit comments

Comments
 (0)