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

This commit is contained in:
Kamil Dudka 2012-03-09 14:07:20 +01:00
parent b2d3e9b880
commit e90969302a
2 changed files with 35 additions and 5 deletions

View File

@ -1,7 +1,7 @@
From a3f59264b9504e8bf3d0ac70b99a237bc964089d Mon Sep 17 00:00:00 2001 From a3f59264b9504e8bf3d0ac70b99a237bc964089d Mon Sep 17 00:00:00 2001
From: Miciah Dashiel Butler Masters <miciah.masters@gmail.com> From: Miciah Dashiel Butler Masters <miciah.masters@gmail.com>
Date: Sat, 18 Jul 2009 23:41:01 +0000 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 Implement new heartbeat code to catch runaway execution of document
ECMAScript code. The old code uses JS_SetBranchCallback which is 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 dcaff5d937d63888c560727dda5f5348fa59a366 Mon Sep 17 00:00:00 2001
From: witekfl <witekfl@poczta.onet.pl> From: witekfl <witekfl@poczta.onet.pl>
Date: Tue, 19 Apr 2011 22:41:05 +0200 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) (xulrunner-2.0 or later)
The code wasn't tested. It compiles 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 32109054ce40067b8c55837fb69f1bc1249e38fd Mon Sep 17 00:00:00 2001
From: witekfl <witekfl@poczta.onet.pl> From: witekfl <witekfl@poczta.onet.pl>
Date: Mon, 25 Apr 2011 21:04:03 +0200 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. In history.back() and others set rval to NULL.
Do not convert NULL to string in spidermoney_eval_stringback. Do not convert NULL to string in spidermoney_eval_stringback.
@ -2323,3 +2323,30 @@ index 752a890..d1fbdfb 100644
-- --
1.7.4.4 1.7.4.4
From 725e389837d565cc3f9e787bd268fa5933c7bbb6 Mon Sep 17 00:00:00 2001
From: witekfl <witekfl@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@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

View File

@ -1,7 +1,7 @@
Name: elinks Name: elinks
Summary: A text-mode Web browser Summary: A text-mode Web browser
Version: 0.12 Version: 0.12
Release: 0.27.pre5%{?dist} Release: 0.28.pre5%{?dist}
License: GPLv2 License: GPLv2
URL: http://elinks.or.cz URL: http://elinks.or.cz
Group: Applications/Internet Group: Applications/Internet
@ -80,7 +80,7 @@ quickly and swiftly displays Web pages.
# Port elinks to use NSS library for cryptography (#346861) - incremental patch # Port elinks to use NSS library for cryptography (#346861) - incremental patch
%patch10 -p1 %patch10 -p1
# backported upstream commits f31cf6f, 2844f8b, and 218a225 # backported upstream commits f31cf6f, 2844f8b, 218a225, and 12803e4
%patch11 -p1 %patch11 -p1
# remove bogus serial numbers # remove bogus serial numbers
@ -155,6 +155,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man5/* %{_mandir}/man5/*
%changelog %changelog
* Fri Mar 09 2012 Kamil Dudka <kdudka@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@lists.fedoraproject.org> - 0.12-0.27.pre5 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-0.27.pre5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild