Skip to content

Commit 88eb023

Browse files
committed
Refactor taintedString.ql test
1 parent cd661f1 commit 88eb023

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import semmle.code.java.dataflow.FlowSources
22

3-
class Conf extends TaintTracking::Configuration {
4-
Conf() { this = "qltest:cwe-089:taintedString" }
3+
module Config implements DataFlow::ConfigSig {
4+
predicate isSource(DataFlow::Node source) { source instanceof UserInput }
55

6-
override predicate isSource(DataFlow::Node source) { source instanceof UserInput }
7-
8-
override predicate isSink(DataFlow::Node sink) { any() }
6+
predicate isSink(DataFlow::Node sink) { any() }
97
}
108

11-
from Conf conf, Expr tainted, Method method
9+
module Flow = TaintTracking::Global<Config>;
10+
11+
from Expr tainted, Method method
1212
where
13-
conf.hasFlowToExpr(tainted) and
13+
Flow::flowToExpr(tainted) and
1414
tainted.getEnclosingCallable() = method and
1515
tainted.getFile().getStem() = ["Test", "Validation"]
1616
select method, tainted.getLocation().getStartLine() - method.getLocation().getStartLine(), tainted

0 commit comments

Comments
 (0)