From 29e0435a01ea08270f7451cea481cd44f0178b85 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Wed, 16 Mar 2016 22:55:08 +0000 Subject: [PATCH] ICU-12379 Add assertion check to internal function parameter value. X-SVN-Rev: 38524 --- icu4c/source/i18n/regexcmp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/icu4c/source/i18n/regexcmp.cpp b/icu4c/source/i18n/regexcmp.cpp index be8323371a9..6bf2866b2ae 100644 --- a/icu4c/source/i18n/regexcmp.cpp +++ b/icu4c/source/i18n/regexcmp.cpp @@ -2603,7 +2603,11 @@ void RegexCompile::findCaseInsensitiveStarters(UChar32 c, UnicodeSet *starterCh // End of machine generated data. - if (u_hasBinaryProperty(c, UCHAR_CASE_SENSITIVE)) { + if (c < UCHAR_MIN_VALUE || c > UCHAR_MAX_VALUE) { + // This function should never be called with an invalid input character. + U_ASSERT(FALSE); + starterChars->clear(); + } else if (u_hasBinaryProperty(c, UCHAR_CASE_SENSITIVE)) { UChar32 caseFoldedC = u_foldCase(c, U_FOLD_CASE_DEFAULT); starterChars->set(caseFoldedC, caseFoldedC); -- 2.40.0