Skip to content

Commit 375ded4

Browse files
Move check to exlude test cases so that it also covers exponential redos
1 parent 1605d36 commit 375ded4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ private class RegexCompileFlowConf extends DataFlow2::Configuration {
1717
override predicate isSink(DataFlow::Node node) {
1818
sinkNode(node, ["regex-compile", "regex-compile-match", "regex-compile-find"])
1919
}
20+
21+
override predicate isBarrier(DataFlow::Node node) {
22+
node.getEnclosingCallable().getDeclaringType() instanceof NonSecurityTestClass
23+
}
2024
}
2125

2226
/**
@@ -208,10 +212,6 @@ private class RegexMatchFlowConf extends DataFlow2::Configuration {
208212
override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
209213
any(RegexAdditionalFlowStep s).step(node1, node2)
210214
}
211-
212-
override predicate isBarrier(DataFlow::Node node) {
213-
node.getEnclosingCallable().getDeclaringType() instanceof NonSecurityTestClass
214-
}
215215
}
216216

217217
/**

0 commit comments

Comments
 (0)