Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from cthulhu-node/fix-redos
Browse files Browse the repository at this point in the history
fix REDoS-Attack-vector
  • Loading branch information
Uzlopak authored Mar 7, 2022
2 parents 5dcd474 + d39e243 commit 109a5e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 109a5e3

Please sign in to comment.