mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Use set literal expression
This commit is contained in:
@@ -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"
|
||||
])
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user