Skip to content

Commit 61b8f97

Browse files
committed
C#: Re-factor the flowsources test.
1 parent f00c978 commit 61b8f97

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,13 +1,13 @@
11
import semmle.code.csharp.security.dataflow.flowsources.Stored
22

3-
class StoredConfig extends TaintTracking::Configuration {
4-
StoredConfig() { this = "stored" }
3+
module StoredConfig implements DataFlow::ConfigSig {
4+
predicate isSource(DataFlow::Node s) { s instanceof StoredFlowSource }
55

6-
override predicate isSource(DataFlow::Node s) { s instanceof StoredFlowSource }
7-
8-
override predicate isSink(DataFlow::Node s) { s.asExpr().fromSource() }
6+
predicate isSink(DataFlow::Node s) { s.asExpr().fromSource() }
97
}
108

11-
from StoredConfig s, DataFlow::Node sink
12-
where s.hasFlow(any(StoredFlowSource sfs), sink)
9+
module Stored = TaintTracking::Global<StoredConfig>;
10+
11+
from DataFlow::Node sink
12+
where Stored::flow(any(StoredFlowSource sfs), sink)
1313
select sink

0 commit comments

Comments
 (0)