--- a/jdk/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java Tue Jun 16 14:38:12 2015 -0700
+++ b/jdk/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java Mon Jun 15 12:58:33 2015 +0200
@@ -761,11 +761,15 @@
Class<?> stringArrayClass;
Class<?> targetArrayClass;
try {
+ String baseClassName = baseType.safeGetClassName();
+
+ // check access to the provided base type class name and bail out early
+ ReflectUtil.checkPackageAccess(baseClassName);
+
stringArrayClass =
Class.forName(squareBrackets + "Ljava.lang.String;");
targetArrayClass =
- Class.forName(squareBrackets + "L" + baseType.safeGetClassName() +
- ";");
+ Class.forName(squareBrackets + "L" + baseClassName + ";");
} catch (ClassNotFoundException e) {
throw new NoClassDefFoundError(e.toString()); // can't happen
}