From 3b8c600fbe0add03b038395779182e2a9c48b295 Mon Sep 17 00:00:00 2001 From: Stef Gijsberts Date: Wed, 3 Nov 2021 20:05:27 +0100 Subject: Fix infinite loop LibreJS got stuck in an infinite loop whenever a occured inside a HTML head tag. This was due to a small programming mistake (refer to the git diff for details). It caused Icecat to become unresponsive (tested on Icecat 78.10.0esr). This notably affected users trying to visit lichess.org, and reportedly users trying to visit scratch.mit.edu [0]. [0]: https://lists.gnu.org/archive/html/bug-librejs/2020-06/msg00000.html --- bg/ExternalLicenses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bg') diff --git a/bg/ExternalLicenses.js b/bg/ExternalLicenses.js index d5bcd4e..758b92d 100644 --- a/bg/ExternalLicenses.js +++ b/bg/ExternalLicenses.js @@ -118,7 +118,7 @@ var ExternalLicenses = { cache.webLabels = {href}; let move = () => !!doc.head.insertBefore(link, doc.head.firstChild); if (link.parentNode === doc.head) { - for (let node; node = link.previousElementSibling;) { + for (let node = link; node = node.previousElementSibling;) { if (node.tagName.toUpperCase() === "SCRIPT") { return move(); } -- cgit v1.2.3