mirror of
https://gitee.com/openharmony/third_party_icu
synced 2024-11-23 16:19:42 +00:00
复制字符串越界问题
Signed-off-by: zhangdd_ewan <zhangdongdong50@huawei.com>
This commit is contained in:
parent
588fbf82ad
commit
91935e8afb
@ -829,7 +829,7 @@ PluralRules::getRuleFromResource(const Locale& locale, UPluralType type, UErrorC
|
|||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
char parentLocaleName[ULOC_FULLNAME_CAPACITY];
|
char parentLocaleName[ULOC_FULLNAME_CAPACITY];
|
||||||
const char *curLocaleName2=locale.getBaseName();
|
const char *curLocaleName2=locale.getBaseName();
|
||||||
size_t curLocaleName2Len = std::strlen(curLocaleName2);
|
size_t curLocaleName2Len = strlen(curLocaleName2);
|
||||||
if (curLocaleName2Len > ULOC_FULLNAME_CAPACITY - 1) {
|
if (curLocaleName2Len > ULOC_FULLNAME_CAPACITY - 1) {
|
||||||
uprv_strncpy(parentLocaleName, curLocaleName2, ULOC_FULLNAME_CAPACITY - 1);
|
uprv_strncpy(parentLocaleName, curLocaleName2, ULOC_FULLNAME_CAPACITY - 1);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user