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:
parent
d47eb5d3f2
commit
e3109d4c17
3 changed files with 16 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue