mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
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.
22 lines
572 B
Plaintext
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
|