avoid potential RegExp denial-of-service (#5135)

closes #5133
closes #5134
This commit is contained in:
Alex Lam S.L
2021-09-29 18:49:46 +01:00
committed by GitHub
parent f766babf5e
commit 157521066f
4 changed files with 6 additions and 6 deletions

View File

@@ -2350,7 +2350,7 @@ function patch_try_catch(orig, toplevel) {
tries: [],
} ];
var tail_throw = '\nif (typeof UFUZZ_ERROR == "object") throw UFUZZ_ERROR;\n';
var re = /(?:(?:^|[\s{}):;])try|}\s*catch\s*\(([^)[{]+)\)|}\s*finally)\s*(?={)/g;
var re = /(?:(?:^|[\s{}):;])try|}\s*catch\s*\(([^()[{]+)\)|}\s*finally)\s*(?={)/g;
while (stack.length) {
var code = stack[0].code;
var offset = stack[0].offset;