-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathInlineFlowTest.qll
More file actions
32 lines (26 loc) · 1.07 KB
/
InlineFlowTest.qll
File metadata and controls
32 lines (26 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* Inline flow tests for Go.
* See `shared/util/codeql/dataflow/test/InlineFlowTest.qll`
*/
import go
private import codeql.dataflow.test.InlineFlowTest
private import semmle.go.dataflow.internal.DataFlowImplSpecific
private import semmle.go.dataflow.internal.TaintTrackingImplSpecific
private import semmle.go.dataflow.ExternalFlow as ExternalFlow
private import internal.InlineExpectationsTestImpl
private module FlowTestImpl implements InputSig<Location, GoDataFlow> {
predicate defaultSource(DataFlow::Node source) {
exists(Function fn | fn.hasQualifiedName(_, ["source", "taint"]) |
source = fn.getACall().getResult()
)
}
predicate defaultSink(DataFlow::Node sink) {
exists(Function fn | fn.hasQualifiedName(_, "sink") | sink = fn.getACall().getAnArgument())
}
string getArgString(DataFlow::Node src, DataFlow::Node sink) {
exists(src) and
result = "\"" + sink.toString() + "\""
}
predicate interpretModelForTest = ExternalFlow::interpretModelForTest/2;
}
import InlineFlowTestMake<Location, GoDataFlow, GoTaintTracking, Impl, FlowTestImpl>