Make taint tracking tests use config from InlineFlowTest

This commit is contained in:
Owen Mansel-Chan
2023-07-18 10:10:41 +01:00
parent 8db3e4a9b4
commit 663fb2cc06
2 changed files with 6 additions and 17 deletions

View File

@@ -1,3 +1,4 @@
failures
edges
| test.go:14:8:14:15 | call to source | test.go:15:34:15:35 | fi |
| test.go:15:2:15:44 | ... := ...[0] | test.go:16:7:16:12 | header |

View File

@@ -1,22 +1,10 @@
/**
* @kind path-problem
*/
import go
import DataFlow::PathGraph
import TestUtilities.InlineFlowTest
class Config extends TaintTracking::Configuration {
Config() { this = "config" }
module Flow = TaintTracking::Global<DefaultFlowConfig>;
override predicate isSource(DataFlow::Node n) {
n = any(DataFlow::CallNode call | call.getTarget().getName() = "source").getResult()
}
import Flow::PathGraph
override predicate isSink(DataFlow::Node n) {
n = any(DataFlow::CallNode call | call.getTarget().getName() = "sink").getAnArgument()
}
}
from DataFlow::PathNode source, DataFlow::PathNode sink, Config c
where c.hasFlowPath(source, sink)
from Flow::PathNode source, Flow::PathNode sink
where Flow::flowPath(source, sink)
select source, source, sink, "Path"