8203324: Use out of scope in getMacOSXLocale of java_props_macosx.c:120
Reviewed-by: rriggs
--- a/src/java.base/macosx/native/libjava/java_props_macosx.c Tue Jun 05 11:11:33 2018 -0400
+++ b/src/java.base/macosx/native/libjava/java_props_macosx.c Tue Jun 05 08:33:40 2018 -0700
@@ -47,6 +47,7 @@
#define LOCALEIDLENGTH 128
char *getMacOSXLocale(int cat) {
const char* retVal = NULL;
+ char languageString[LOCALEIDLENGTH];
char localeString[LOCALEIDLENGTH];
switch (cat) {
@@ -67,7 +68,6 @@
CFRelease(languages);
return NULL;
}
- char languageString[LOCALEIDLENGTH];
if (CFStringGetCString(primaryLanguage, languageString,
LOCALEIDLENGTH, CFStringGetSystemEncoding()) == false) {
CFRelease(languages);