changeset 748:6cd78e135d41

Fix potential NPE on GetValue message
author Adam Domurad <adomurad@redhat.com>
date Fri, 28 Jun 2013 10:07:19 -0400
parents be23db7861a6
children e18d9ba86575
files ChangeLog plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jun 28 14:02:37 2013 +0200
+++ b/ChangeLog	Fri Jun 28 10:07:19 2013 -0400
@@ -1,3 +1,8 @@
+2013-06-28  Adam Domurad  <adomurad@redhat.com>
+
+	* plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java
+	(handleMessage): Fix potential NPE on 'GetValue'
+
 2013-06-24  Jiri Vanek <jvanek@redhat.com>
 
 	JNLP file is now re-downloading only if is local and have href
--- a/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java	Fri Jun 28 14:02:37 2013 +0200
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java	Fri Jun 28 10:07:19 2013 -0400
@@ -522,8 +522,9 @@
                 Integer index = parseCall(args[1], null, Integer.class);
 
                 Object ret = store.getObject(index);
+                Class<?> retClass = ret != null ? ret.getClass() : null;
 
-                String objIDStr = toObjectIDString(ret, ret.getClass(), true /*unbox primitives*/);
+                String objIDStr = toObjectIDString(ret, retClass, true /*unbox primitives*/);
                 write(reference, "GetValue " + objIDStr);
             } else if (message.startsWith("SetStaticField") ||
                                    message.startsWith("SetField")) {