ObjectInputStream.java (enableResolveObject): Use correct security check.
* java/io/ObjectInputStream.java (enableResolveObject): Use correct security check. * java/io/ObjectOutputStream.java (enableReplaceObject): Use correct security check. From-SVN: r48256
This commit is contained in:
@@ -528,8 +528,11 @@ public class ObjectInputStream extends InputStream
|
||||
throws SecurityException
|
||||
{
|
||||
if (enable)
|
||||
if (getClass ().getClassLoader () != null)
|
||||
throw new SecurityException ("Untrusted ObjectInputStream subclass attempted to enable object resolution");
|
||||
{
|
||||
SecurityManager sm = System.getSecurityManager ();
|
||||
if (sm != null)
|
||||
sm.checkPermission (new SerializablePermission ("enableSubtitution"));
|
||||
}
|
||||
|
||||
boolean old_val = this.resolveEnabled;
|
||||
this.resolveEnabled = enable;
|
||||
|
||||
Reference in New Issue
Block a user