Skip to content

Commit 1f0fbfa

Browse files
committed
C#: Re-factor the EntityFramework test.
1 parent 4023cd3 commit 1f0fbfa

File tree

1 file changed

+8
-8
lines changed
  • csharp/ql/test/library-tests/frameworks/EntityFramework

1 file changed

+8
-8
lines changed

csharp/ql/test/library-tests/frameworks/EntityFramework/Dataflow.ql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
*/
44

55
import csharp
6-
import DataFlow::PathGraph
6+
import Taint::PathGraph
77

8-
class MyConfiguration extends TaintTracking::Configuration {
9-
MyConfiguration() { this = "EntityFramework dataflow" }
8+
module TaintConfig implements DataFlow::ConfigSig {
9+
predicate isSource(DataFlow::Node node) { node.asExpr().getValue() = "tainted" }
1010

11-
override predicate isSource(DataFlow::Node node) { node.asExpr().getValue() = "tainted" }
12-
13-
override predicate isSink(DataFlow::Node node) {
11+
predicate isSink(DataFlow::Node node) {
1412
node.asExpr() = any(MethodCall c | c.getTarget().hasName("Sink")).getAnArgument()
1513
}
1614
}
1715

18-
from DataFlow::PathNode source, DataFlow::PathNode sink, MyConfiguration conf
19-
where conf.hasFlowPath(source, sink)
16+
module Taint = TaintTracking::Global<TaintConfig>;
17+
18+
from Taint::PathNode source, Taint::PathNode sink
19+
where Taint::flowPath(source, sink)
2020
select sink, source, sink, "$@", source, source.toString()

0 commit comments

Comments
 (0)