aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net
diff options
context:
space:
mode:
authorOmair Majid <[email protected]>2011-03-01 18:22:17 -0500
committerOmair Majid <[email protected]>2011-03-01 18:22:17 -0500
commitfad20c1db5bf1f1f1a5d583a805d6c5d5553a439 (patch)
tree27e138b96490286f533ffe0aa610d9a984c2a53c /netx/net
parent1ac3f509d9d1f3ae72a71e3f5e2397d396b0a083 (diff)
Check for nulls in JNLPPolicy.isSystemJar
It is possible to have CodeSource.getLocation() return null. For example, sun.applet.AppletPanel (line 1071) queries the policy using a null Location p.getPermissions(new CodeSource(null, (java.security.cert.Certificate[]) null)) 2011-03-01 Omair Majid <[email protected]> * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java (isSystemJar): Check for nulls.
Diffstat (limited to 'netx/net')
-rw-r--r--netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java b/netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java
index 13f72e6..ba9b53e 100644
--- a/netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java
@@ -137,6 +137,10 @@ public class JNLPPolicy extends Policy {
* it's part of the JRE.
*/
private boolean isSystemJar(CodeSource source) {
+ if (source == null || source.getLocation() == null) {
+ return false;
+ }
+
// anything in JRE/lib/ext is a system jar and has full permissions
String sourceProtocol = source.getLocation().getProtocol();
String sourcePath = source.getLocation().getPath();