20 lines
873 B
Diff
20 lines
873 B
Diff
--- misc/icu/source/source/common/uloc.c
|
|
+++ misc/build/icu/source/common/uloc.c
|
|
@@ -1797,7 +1797,7 @@
|
|
int32_t variantLen = _deleteVariant(variant, uprv_min(variantSize, (nameCapacity-len)), variantToCompare, n);
|
|
len -= variantLen;
|
|
if (variantLen > 0) {
|
|
- if (name[len-1] == '_') { /* delete trailing '_' */
|
|
+ if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
|
|
--len;
|
|
}
|
|
addKeyword = VARIANT_MAP[j].keyword;
|
|
@@ -1805,7 +1805,7 @@
|
|
break;
|
|
}
|
|
}
|
|
- if (name[len-1] == '_') { /* delete trailing '_' */
|
|
+ if (len > 0 && len <= nameCapacity && name[len-1] == '_') { /* delete trailing '_' */
|
|
--len;
|
|
}
|
|
}
|