mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
We are no longer bound to the platform-specific directories, so simplify the test organization. If you don't want this change, just skip merging this PR. It's purely optional. I kept the platform-specific directories around under `kotlin`, but you could also easily merge all these together if you find them unhelpful. I'll leave that change to you.
36 lines
956 B
Plaintext
36 lines
956 B
Plaintext
import java
|
|
import semmle.code.java.dataflow.TaintTracking
|
|
import TestUtilities.InlineExpectationsTest
|
|
private import semmle.code.java.dataflow.ExternalFlow
|
|
|
|
module Config implements DataFlow::ConfigSig {
|
|
predicate isSource(DataFlow::Node n) {
|
|
n.asExpr().(MethodCall).getCallee().getName() = "source"
|
|
or
|
|
sourceNode(n, "kotlinMadFlowTest")
|
|
}
|
|
|
|
predicate isSink(DataFlow::Node n) {
|
|
n.asExpr().(Argument).getCall().getCallee().getName() = "sink"
|
|
or
|
|
sinkNode(n, "kotlinMadFlowTest")
|
|
}
|
|
}
|
|
|
|
module Flow = TaintTracking::Global<Config>;
|
|
|
|
module InlineFlowTest implements TestSig {
|
|
string getARelevantTag() { result = "flow" }
|
|
|
|
predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
tag = "flow" and
|
|
exists(DataFlow::Node sink | Flow::flowTo(sink) |
|
|
sink.getLocation() = location and
|
|
element = sink.toString() and
|
|
value = ""
|
|
)
|
|
}
|
|
}
|
|
|
|
import MakeTest<InlineFlowTest>
|