From d39e2431471c6930824230b5314062f34b2f3437 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Mon, 7 Mar 2022 20:06:39 +0100 Subject: [PATCH] fix REDoS-Attack-vector --- benchmark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark.js b/benchmark.js index c5574f4c..49763f8e 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; }