mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-11793 Add validation check to len
X-SVN-Rev: 38080
This commit is contained in:
parent
9409eecc4c
commit
385c8dd53d
1 changed files with 2 additions and 2 deletions
|
@ -2132,13 +2132,13 @@ uloc_getLCID(const char* localeID)
|
|||
len = uloc_getBaseName(localeID, tmpLocaleID,
|
||||
sizeof(tmpLocaleID)/sizeof(tmpLocaleID[0]) - 1, &status);
|
||||
|
||||
if (U_SUCCESS(status)) {
|
||||
if (U_SUCCESS(status) && len > 0) {
|
||||
tmpLocaleID[len] = 0;
|
||||
|
||||
len = uloc_setKeywordValue("collation", collVal, tmpLocaleID,
|
||||
sizeof(tmpLocaleID)/sizeof(tmpLocaleID[0]) - len - 1, &status);
|
||||
|
||||
if (U_SUCCESS(status)) {
|
||||
if (U_SUCCESS(status) && len > 0) {
|
||||
tmpLocaleID[len] = 0;
|
||||
return uprv_convertToLCID(langID, tmpLocaleID, &status);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue