From 7067fc7af9fb3af98c09f5b98632c9ef90849b8e Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 8 Feb 2009 23:07:22 +0200 Subject: [PATCH 1/3] Check for JS_ReportAllocationOverflow before using it. Debian libmozjs-dev 1.9.0.4-2 has JS_ReportAllocationOverflow but js-1.7.0 reportedly hasn't. Check at configure time whether that function is available. If not, use JS_ReportOutOfMemory instead. Reported by Witold Filipczyk. --- configure.in | 3 +++ src/scripting/smjs/core.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/configure.in b/configure.in index 27c7a847..d32e691d 100644 --- a/configure.in +++ b/configure.in @@ -629,6 +629,9 @@ fi AC_MSG_RESULT($cf_result) CONFIG_SPIDERMONKEY="$cf_result" +if test "$cf_result" = "yes"; then + AC_CHECK_FUNCS([[JS_ReportAllocationOverflow]]) +fi EL_RESTORE_FLAGS if test "x$CONFIG_SPIDERMONKEY" = xyes && diff --git a/src/scripting/smjs/core.c b/src/scripting/smjs/core.c index 57a8eb41..4582da3a 100644 --- a/src/scripting/smjs/core.c +++ b/src/scripting/smjs/core.c @@ -195,7 +195,11 @@ utf8_to_jsstring(JSContext *ctx, const unsigned char *str, int length) * Check whether the multiplication could overflow. */ assert(!needs_utf16_surrogates(UCS_REPLACEMENT_CHARACTER)); if (in_bytes > ((size_t) -1) / sizeof(jschar)) { +#ifdef HAVE_JS_REPORTALLOCATIONOVERFLOW JS_ReportAllocationOverflow(ctx); +#else + JS_ReportOutOfMemory(ctx); +#endif return NULL; } utf16_alloc = in_bytes; From c53e6335a18392dc58115f92e12971c25671f5d0 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Mon, 9 Feb 2009 00:24:13 +0200 Subject: [PATCH 2/3] Mention bug 761 in NEWS. --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 340b5a48..9ce8b23a 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,8 @@ Other changes: title, note the charset. Don't truncate titles to the width of the terminal. * bug 1061: Correctly truncate UTF-8 titles in the tab bar. +* minor bug 761: When reading bookmarks from an XBEL file, distinguish + attribute names from attribute values. * enhancement: Updated ISO 8859-7, ISO 8859-16, KOI8-R, and MacRoman. ELinks 0.12pre2: From a7c2f14e6d0d3753ca0b5fd3e149d6f12492bba5 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 12 Feb 2009 09:48:04 +0100 Subject: [PATCH 3/3] bug 1067: the node was freed, but still used. --- NEWS | 1 + src/document/dom/renderer.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 9ce8b23a..b47b0eba 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,7 @@ Other changes: * minor bug 761: When reading bookmarks from an XBEL file, distinguish attribute names from attribute values. * enhancement: Updated ISO 8859-7, ISO 8859-16, KOI8-R, and MacRoman. +* critical: bug 1067: crash in call_dom_stack_callbacks with RSS ELinks 0.12pre2: ---------------- diff --git a/src/document/dom/renderer.c b/src/document/dom/renderer.c index 746e3aab..35ac4810 100644 --- a/src/document/dom/renderer.c +++ b/src/document/dom/renderer.c @@ -947,9 +947,7 @@ dom_rss_pop_document(struct dom_stack *stack, struct dom_node *root, void *data) done_dom_string(&renderer->text); mem_free_if(renderer->items); - done_dom_node(root); - - return DOM_CODE_OK; + return DOM_CODE_FREE_NODE; }