From 947fba8ddc5c43e7480e772c80f0c80483964443 Mon Sep 17 00:00:00 2001 From: fuzzybuzz <63451192+fuzzybuzz@users.noreply.github.com> Date: Sun, 12 Apr 2020 12:07:53 +0100 Subject: [PATCH] Remove * Quantifier to avoid ReDoS --- benchmark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark.js b/benchmark.js index f142b3c6..743b00c7 100644 --- a/benchmark.js +++ b/benchmark.js @@ -591,7 +591,7 @@ result = (result || '').replace(/^\s+|\s+$/g, ''); // Detect strings containing only the "use strict" directive. - return /^(?:\/\*+[\w\W]*?\*\/|\/\/.*?[\n\r\u2028\u2029]|\s)*(["'])use strict\1;?$/.test(result) + return /^(?:\/\*[\w\W]*?\*\/|\/\/.*?[\n\r\u2028\u2029]|\s)*(["'])use strict\1;?$/.test(result) ? '' : result; }