mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-22198 Fix stack buffer overflow.
This commit is contained in:
parent
9c1fb785b3
commit
8b7ef3d908
1 changed files with 2 additions and 1 deletions
|
@ -202,7 +202,8 @@ typedef enum UResOpenType UResOpenType;
|
|||
*/
|
||||
static bool getParentLocaleID(char *name, const char *origName, UResOpenType openType) {
|
||||
// early out if the locale ID has a variant code or ends with _
|
||||
if (name[uprv_strlen(name) - 1] == '_' || hasVariant(name)) {
|
||||
size_t nameLen = uprv_strlen(name);
|
||||
if (!nameLen || name[nameLen - 1] == '_' || hasVariant(name)) {
|
||||
return chopLocale(name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue