...
Issues caused because of not checking for null, leading to compromise.
Noncompliant Code Example
Code Block |
---|
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
...
}
}, acc); |
Compliant Solution
Code Block |
---|
if (acc == null) {
throw new SecurityException("Missing AccessControlContext");
}
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
...
}
}, acc); |
Noncompliant Code Example
Code Block |
---|
System.setSecurityManager(null); |