changeset 2311:09eef2decb0f

Fix PR619: Improper finalization by the plugin can crash the browser
author Deepak Bhole <dbhole@redhat.com>
date Thu, 20 Jan 2011 11:11:20 -0500
parents 6ec6e96141d8
children 388e5f866df3
files ChangeLog NEWS plugin/icedteanp/java/netscape/javascript/JSObject.java
diffstat 3 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jan 18 15:17:47 2011 +0000
+++ b/ChangeLog	Thu Jan 20 11:11:20 2011 -0500
@@ -1,3 +1,9 @@
+2011-01-20  Deepak Bhole <dbhole@redhat.com>
+
+	PR619: Improper finalization by the plugin can crash the browser
+	* plugin/icedteanp/java/netscape/javascript/JSObject.java (finalize):
+	Proceed with finalization only if JSObject is valid.
+
 2011-01-18  Andrew John Hughes  <ahughes@redhat.com>
 
 	* configure.ac: Bump to 1.9.5pre.
--- a/NEWS	Tue Jan 18 15:17:47 2011 +0000
+++ b/NEWS	Thu Jan 20 11:11:20 2011 -0500
@@ -16,6 +16,7 @@
   - S6782079: PNG: reading metadata may cause OOM on truncated images
 * Fixes
   - RH647157,RH582455: Update fontconfig files for rhel 6
+  - PR619: Improper finalization by the plugin can crash the browser
 
 New in release 1.9.4 (2011-01-18):
 
--- a/plugin/icedteanp/java/netscape/javascript/JSObject.java	Tue Jan 18 15:17:47 2011 +0000
+++ b/plugin/icedteanp/java/netscape/javascript/JSObject.java	Thu Jan 20 11:11:20 2011 -0500
@@ -279,6 +279,11 @@
      */
     protected void	finalize()
     {
+
+        // Proceed if this is a valid object (0L == default long == invalid)
+        if (internal == 0L)
+            return;
+
         PluginDebug.debug("JSObject.finalize ");
         PluginAppletViewer.JavaScriptFinalize(internal);
     }