skip analyzing regular expressions in minified files for ReDoS

This commit is contained in:
Erik Krogh Kristensen
2021-01-21 22:31:42 +01:00
parent d0b70d15f0
commit 62746bbbac

View File

@@ -112,7 +112,9 @@ class RegExpRoot extends RegExpTerm {
// there are no lookbehinds
not exists(RegExpLookbehind lbh | getRoot(lbh) = this) and
// is actually used as a RegExp
isUsedAsRegExp()
isUsedAsRegExp() and
// is not inside a minified file.
not getRootTerm().getParent().(Expr).getTopLevel().isMinified()
}
}