[elinks/f17] do not crash if add_heartbeat() returned NULL (#798103)

Kamil Dudka kdudka at fedoraproject.org
Fri Mar 9 13:11:18 UTC 2012


commit be12acd769b3b7d8cd467a67f4a9a6b48d639505
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Fri Mar 9 14:07:20 2012 +0100

    do not crash if add_heartbeat() returned NULL (#798103)

 elinks-0.12pre5-js185.patch |   33 ++++++++++++++++++++++++++++++---
 elinks.spec                 |    7 +++++--
 2 files changed, 35 insertions(+), 5 deletions(-)
---
diff --git a/elinks-0.12pre5-js185.patch b/elinks-0.12pre5-js185.patch
index 37fb244..ff822d7 100644
--- a/elinks-0.12pre5-js185.patch
+++ b/elinks-0.12pre5-js185.patch
@@ -1,7 +1,7 @@
 From a3f59264b9504e8bf3d0ac70b99a237bc964089d Mon Sep 17 00:00:00 2001
 From: Miciah Dashiel Butler Masters <miciah.masters at gmail.com>
 Date: Sat, 18 Jul 2009 23:41:01 +0000
-Subject: [PATCH 1/3] Heartbeat code using JS_TriggerOperationCallback
+Subject: [PATCH 1/4] Heartbeat code using JS_TriggerOperationCallback
 
 Implement new heartbeat code to catch runaway execution of document
 ECMAScript code.  The old code uses JS_SetBranchCallback which is
@@ -378,7 +378,7 @@ index 0000000..f7c8b12
 From dcaff5d937d63888c560727dda5f5348fa59a366 Mon Sep 17 00:00:00 2001
 From: witekfl <witekfl at poczta.onet.pl>
 Date: Tue, 19 Apr 2011 22:41:05 +0200
-Subject: [PATCH 2/3] JS_VERSION at least 185 is required for ECMASCript
+Subject: [PATCH 2/4] JS_VERSION at least 185 is required for ECMASCript
  (xulrunner-2.0 or later)
 
 The code wasn't tested. It compiles
@@ -2269,7 +2269,7 @@ index 64f43ca..636b37b 100644
 From 32109054ce40067b8c55837fb69f1bc1249e38fd Mon Sep 17 00:00:00 2001
 From: witekfl <witekfl at poczta.onet.pl>
 Date: Mon, 25 Apr 2011 21:04:03 +0200
-Subject: [PATCH 3/3] SpiderMonkey: fix issue with javascript:history.back()
+Subject: [PATCH 3/4] SpiderMonkey: fix issue with javascript:history.back()
 
 In history.back() and others set rval to NULL.
 Do not convert NULL to string in spidermoney_eval_stringback.
@@ -2323,3 +2323,30 @@ index 752a890..d1fbdfb 100644
  
 -- 
 1.7.4.4
+
+
+From 725e389837d565cc3f9e787bd268fa5933c7bbb6 Mon Sep 17 00:00:00 2001
+From: witekfl <witekfl at poczta.onet.pl>
+Date: Sun, 4 Mar 2012 18:20:48 +0100
+Subject: [PATCH 4/4] Check if hb is NULL.
+
+Signed-off-by: Kamil Dudka <kdudka at redhat.com>
+---
+ src/ecmascript/spidermonkey/heartbeat.c |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/src/ecmascript/spidermonkey/heartbeat.c b/src/ecmascript/spidermonkey/heartbeat.c
+index bf95d92..b3dff58 100644
+--- a/src/ecmascript/spidermonkey/heartbeat.c
++++ b/src/ecmascript/spidermonkey/heartbeat.c
+@@ -111,6 +111,7 @@ add_heartbeat(struct ecmascript_interpreter *interpreter)
+ void
+ done_heartbeat(struct heartbeat *hb)
+ {
++	if (!hb) return; /* add_heartbeat returned NULL */
+ 	assert(hb->interpreter);
+ 
+         /* Stop the heartbeat timer if this heartbeat is the only one. */
+-- 
+1.7.9.1
+
diff --git a/elinks.spec b/elinks.spec
index 5743179..5f7c092 100644
--- a/elinks.spec
+++ b/elinks.spec
@@ -1,7 +1,7 @@
 Name:      elinks
 Summary:   A text-mode Web browser
 Version:   0.12
-Release:   0.27.pre5%{?dist}
+Release:   0.28.pre5%{?dist}
 License:   GPLv2
 URL:       http://elinks.or.cz
 Group:     Applications/Internet
@@ -80,7 +80,7 @@ quickly and swiftly displays Web pages.
 # Port elinks to use NSS library for cryptography (#346861) - incremental patch
 %patch10 -p1
 
-# backported upstream commits f31cf6f, 2844f8b, and 218a225
+# backported upstream commits f31cf6f, 2844f8b, 218a225, and 12803e4
 %patch11 -p1
 
 # remove bogus serial numbers
@@ -155,6 +155,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man5/*
 
 %changelog
+* Fri Mar 09 2012 Kamil Dudka <kdudka at redhat.com> - 0.12-0.28.pre5
+- do not crash if add_heartbeat() returned NULL (#798103)
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.12-0.27.pre5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list