8229785: MethodType::fromMethodDescriptorString should require security permission if loader is null

Reviewed-by: vromero
This commit is contained in:
Mandy Chung 2019-09-10 10:35:52 -07:00
parent 5dc5bc881a
commit 5d397eea9f
9 changed files with 250 additions and 9 deletions

View file

@ -90,9 +90,7 @@ public class BytecodeDescriptor {
i[0] = endc+1;
String name = str.substring(begc, endc).replace('/', '.');
try {
return (loader == null)
? Class.forName(name, false, null)
: loader.loadClass(name);
return Class.forName(name, false, loader);
} catch (ClassNotFoundException ex) {
throw new TypeNotPresentException(name, ex);
}