changeset 323:41f03d932cdf icedtea-web-1.2-branchpoint

PR838: IcedTea plugin crashes with chrome browser when javascript is executed
author Deepak Bhole <dbhole@redhat.com>
date Mon, 09 Jan 2012 18:45:31 -0500
parents 0e524d940827
children 21183f821dd4
files ChangeLog NEWS plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
diffstat 3 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jan 06 12:14:56 2012 -0500
+++ b/ChangeLog	Mon Jan 09 18:45:31 2012 -0500
@@ -1,3 +1,10 @@
+2012-01-09  Deepak Bhole <dbhole@redhat.com>
+
+	PR838: IcedTea plugin crashes with chrome browser when javascript is executed
+	* plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (eval): Added a check
+	to ensure that the result pointer is valid before attempting to create an
+	NPVariant from it.
+
 2012-01-05  Omair Majid <omajid@redhat.com>
 
 	* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
--- a/NEWS	Fri Jan 06 12:14:56 2012 -0500
+++ b/NEWS	Mon Jan 09 18:45:31 2012 -0500
@@ -21,6 +21,7 @@
 * Plugin
   - PR749: sun.applet.PluginStreamHandler#handleMessage(String) really slow
   - PR782: Support building against npapi-sdk as well
+  - PR838: IcedTea plugin crashes with chrome browser when javascript is executed
   - RH586194: Unable to connect to connect with Juniper VPN client
   - RH718693: MindTerm SSH Applet doesn't work
 Common
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc	Fri Jan 06 12:14:56 2012 -0500
+++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc	Mon Jan 09 18:45:31 2012 -0500
@@ -243,7 +243,13 @@
 
     NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(thread_data.result);
     std::string result_variant_jniid = std::string();
-    createJavaObjectFromVariant(instance, *result_variant, &result_variant_jniid);
+    if (result_variant)
+    {
+        createJavaObjectFromVariant(instance, *result_variant, &result_variant_jniid);
+    } else
+    {
+        result_variant_jniid = "0";
+    }
 
     IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
     response += " JavaScriptEval ";