8187772: JVM crash when currency set on MacOS 10.10 and earlier
Reviewed-by: naoto
--- a/src/java.base/macosx/native/libjava/java_props_macosx.c Mon Oct 16 18:27:07 2017 +0200
+++ b/src/java.base/macosx/native/libjava/java_props_macosx.c Mon Oct 16 11:20:59 2017 -0700
@@ -113,6 +113,12 @@
}
if (retVal != NULL) {
+ // convertToPOSIXLocale() does not expect any variant codes, so ignore
+ // '@' and anything following, if present.
+ char* rmAt = strchr(retVal, '@');
+ if (rmAt != NULL) {
+ *rmAt = '\0';
+ }
return strdup(convertToPOSIXLocale(retVal));
}