Files
codeql/cpp/ql/test/library-tests/dataflow/additional-flow-to-parameter/standardFlow.ql
Jeroen Ketema fc2013334f C++: Do not use the old dataflow library in additional-flow-to-parameter
Either both queries here should use the old library or neither should. The
expectation is that the expected results between the queries differ depending
on the additional flow step in one of them.
2022-11-04 15:46:36 +01:00

22 lines
572 B
Plaintext

import cpp
import semmle.code.cpp.dataflow.DataFlow
class TestConfig extends DataFlow::Configuration {
TestConfig() { this = "TestConfig" }
override predicate isSource(DataFlow::Node source) {
source.asExpr().(FunctionCall).getTarget().getName() = "source"
}
override predicate isSink(DataFlow::Node sink) {
exists(FunctionCall call |
call.getTarget().getName() = "sink" and
sink.asExpr() = call.getAnArgument()
)
}
}
from DataFlow::Node sink, DataFlow::Node source, TestConfig cfg
where cfg.hasFlow(source, sink)
select sink, source