mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
C#: Re-factor the Async test.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import csharp
|
||||
import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
|
||||
import Taint::PathGraph
|
||||
|
||||
class MySink extends DataFlow::ExprNode {
|
||||
MySink() {
|
||||
@@ -19,15 +19,15 @@ class MySource extends DataFlow::ParameterNode {
|
||||
}
|
||||
}
|
||||
|
||||
class MyConfig extends TaintTracking::Configuration {
|
||||
MyConfig() { this = "MyConfig" }
|
||||
module TaintConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source instanceof MySource }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) { source instanceof MySource }
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) { sink instanceof MySink }
|
||||
predicate isSink(DataFlow::Node sink) { sink instanceof MySink }
|
||||
}
|
||||
|
||||
from MyConfig c, DataFlow::PathNode source, DataFlow::PathNode sink
|
||||
where c.hasFlowPath(source, sink)
|
||||
module Taint = TaintTracking::Global<TaintConfig>;
|
||||
|
||||
from Taint::PathNode source, Taint::PathNode sink
|
||||
where Taint::flowPath(source, sink)
|
||||
select sink.getNode(), source, sink, "$@ flows to here and is used.", source.getNode(),
|
||||
"User-provided value"
|
||||
|
||||
Reference in New Issue
Block a user