8187772: JVM crash when currency set on MacOS 10.10 and earlier
authorbchristi
Mon, 16 Oct 2017 11:20:59 -0700
changeset 47352 33ac30e17843
parent 47351 fff3970bd14f
child 47353 a6d4932d582e
8187772: JVM crash when currency set on MacOS 10.10 and earlier Reviewed-by: naoto
src/java.base/macosx/native/libjava/java_props_macosx.c
--- 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));
     }