ICU-13263 uprv_convertToPosix uses a local stack variable out of scope.

X-SVN-Rev: 40234
This commit is contained in:
Jeff Genovy 2017-07-05 18:46:18 +00:00
parent d10a5a945b
commit 03829ff838

View File

@ -1062,6 +1062,8 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr
const char *pPosixID = NULL;
#ifdef USE_WINDOWS_LCID_MAPPING_API
char locName[LOCALE_NAME_MAX_LENGTH] = {}; // ICU name can't be longer than Windows name
// Note: Windows primary lang ID 0x92 in LCID is used for Central Kurdish and
// GetLocaleInfo() maps such LCID to "ku". However, CLDR uses "ku" for
// Northern Kurdish and "ckb" for Central Kurdish. For this reason, we cannot
@ -1069,7 +1071,6 @@ uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UEr
if ((hostid & 0x3FF) != 0x92) {
int32_t tmpLen = 0;
UChar windowsLocaleName[LOCALE_NAME_MAX_LENGTH]; // ULOC_FULLNAME_CAPACITY > LOCALE_NAME_MAX_LENGTH
char locName[LOCALE_NAME_MAX_LENGTH]; // ICU name can't be longer than Windows name
// Note: LOCALE_ALLOW_NEUTRAL_NAMES was enabled in Windows7+, prior versions did not handle neutral (no-region) locale names.
tmpLen = LCIDToLocaleName(hostid, (PWSTR)windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName), LOCALE_ALLOW_NEUTRAL_NAMES);