Skip to content

Commit bd88620

Browse files
committed
C#: Re-factor the Async test.
1 parent a98cf0a commit bd88620

File tree

1 file changed

+8
-8
lines changed
  • csharp/ql/test/library-tests/dataflow/async

1 file changed

+8
-8
lines changed

csharp/ql/test/library-tests/dataflow/async/Async.ql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import csharp
2-
import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
2+
import Taint::PathGraph
33

44
class MySink extends DataFlow::ExprNode {
55
MySink() {
@@ -19,15 +19,15 @@ class MySource extends DataFlow::ParameterNode {
1919
}
2020
}
2121

22-
class MyConfig extends TaintTracking::Configuration {
23-
MyConfig() { this = "MyConfig" }
22+
module TaintConfig implements DataFlow::ConfigSig {
23+
predicate isSource(DataFlow::Node source) { source instanceof MySource }
2424

25-
override predicate isSource(DataFlow::Node source) { source instanceof MySource }
26-
27-
override predicate isSink(DataFlow::Node sink) { sink instanceof MySink }
25+
predicate isSink(DataFlow::Node sink) { sink instanceof MySink }
2826
}
2927

30-
from MyConfig c, DataFlow::PathNode source, DataFlow::PathNode sink
31-
where c.hasFlowPath(source, sink)
28+
module Taint = TaintTracking::Global<TaintConfig>;
29+
30+
from Taint::PathNode source, Taint::PathNode sink
31+
where Taint::flowPath(source, sink)
3232
select sink.getNode(), source, sink, "$@ flows to here and is used.", source.getNode(),
3333
"User-provided value"

0 commit comments

Comments
 (0)