mirror of
https://github.com/github/codeql.git
synced 2026-05-25 00:27:09 +02:00
Add an endpoint filter to filter out flow steps
This commit is contained in:
@@ -487,6 +487,22 @@ private class IsExternalCharacteristic extends StandardEndpointFilterCharacteris
|
||||
not exists(n.getLocation().getFile().getRelativePath())
|
||||
}
|
||||
}
|
||||
|
||||
private class IsFlowStep extends StandardEndpointFilterCharacteristic {
|
||||
IsFlowStep() { this = "flow step" }
|
||||
|
||||
override predicate appliesToEndpoint(DataFlow::Node n) {
|
||||
exists(Call call | n.asExpr() = call.getAnArgument() | isKnownStepSrc(n))
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the node `n` is known as the predecessor in a modeled flow step.
|
||||
*/
|
||||
private predicate isKnownStepSrc(DataFlow::Node n) {
|
||||
any(TaintTracking::Configuration c).isAdditionalFlowStep(n, _) or
|
||||
TaintTracking::localTaintStep(n, _)
|
||||
}
|
||||
}
|
||||
// class IsArgumentToModeledFunctionCharacteristic extends StandardEndpointFilterCharacteristic {
|
||||
// IsArgumentToModeledFunctionCharacteristic() { this = "argument to modeled function" }
|
||||
// override predicate appliesToEndpoint(DataFlow::Node n) {
|
||||
|
||||
Reference in New Issue
Block a user