Use set literal expression

This commit is contained in:
edvraa
2021-04-22 09:48:46 +03:00
parent 9774b24c4e
commit 86444bfa09

View File

@@ -27,35 +27,23 @@ class RegexSink extends DataFlow::ExprNode {
m.getDeclaringType() instanceof TypeString and
(
ma.getArgument(0) = this.asExpr() and
(
m.hasName("matches") or
m.hasName("split") or
m.hasName("replaceFirst") or
m.hasName("replaceAll")
)
m.hasName(["matches", "split", "replaceFirst", "replaceAll"])
)
or
m.getDeclaringType().hasQualifiedName("java.util.regex", "Pattern") and
(
ma.getArgument(0) = this.asExpr() and
(
m.hasName("compile") or
m.hasName("matches")
)
m.hasName(["compile", "matches"])
)
or
m.getDeclaringType().hasQualifiedName("org.apache.commons.lang3", "RegExUtils") and
(
ma.getArgument(1) = this.asExpr() and
m.getParameterType(1).(Class) instanceof TypeString and
(
m.hasName("removeAll") or
m.hasName("removeFirst") or
m.hasName("removePattern") or
m.hasName("replaceAll") or
m.hasName("replaceFirst") or
m.hasName("replacePattern")
)
m.hasName([
"removeAll", "removeFirst", "removePattern", "replaceAll", "replaceFirst",
"replacePattern"
])
)
)
)