From 0253c828d96b6b97347b432b4f43d63522fe7016 Mon Sep 17 00:00:00 2001 From: taiyang-li <654010905@qq.com> Date: Mon, 15 Jul 2024 15:11:24 +0800 Subject: [PATCH] ICU-22832 Fix msan complain about use-of-uninitialized-value --- icu4c/source/common/ustrcase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/icu4c/source/common/ustrcase.cpp b/icu4c/source/common/ustrcase.cpp index bb63dbe9a15c..58b5c5ef6235 100644 --- a/icu4c/source/common/ustrcase.cpp +++ b/icu4c/source/common/ustrcase.cpp @@ -272,7 +272,7 @@ int32_t toLower(int32_t caseLocale, uint32_t options, } else { c = lead; } - const char16_t *s; + const char16_t *s = nullptr; if (caseLocale >= 0) { csc->cpStart = cpStart; csc->cpLimit = srcIndex; @@ -369,7 +369,7 @@ int32_t toUpper(int32_t caseLocale, uint32_t options, c = lead; } csc->cpLimit = srcIndex; - const char16_t *s; + const char16_t *s = nullptr; c = ucase_toFullUpper(c, utf16_caseContextIterator, csc, &s, caseLocale); if (c >= 0) { destIndex = appendUnchanged(dest, destIndex, destCapacity, @@ -579,8 +579,8 @@ ustrcase_internalToTitle(int32_t caseLocale, uint32_t options, BreakIterator *it } if (c == u'I' || c == u'Í') { - titleLimit = maybeTitleDutchIJ(src, c, titleStart + 1, index, - dest, destIndex, destCapacity, options, + titleLimit = maybeTitleDutchIJ(src, c, titleStart + 1, index, + dest, destIndex, destCapacity, options, edits); } }