mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Simplify StartsWithCheck
This commit is contained in:
@@ -21,11 +21,16 @@ class CsvInjectionFlowConfig extends TaintTracking::Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class StartsWithCheck extends DataFlow::BarrierGuard {
|
private class StartsWithCheck extends DataFlow::BarrierGuard {
|
||||||
StartsWithCheck() { this.(CallNode).getNode().getFunc().(Attribute).getName() = "startswith" }
|
Attribute attr;
|
||||||
|
|
||||||
|
StartsWithCheck() {
|
||||||
|
this.(CallNode).getNode().getFunc() = attr and
|
||||||
|
attr.getName() = "startswith"
|
||||||
|
}
|
||||||
|
|
||||||
override predicate checks(ControlFlowNode node, boolean branch) {
|
override predicate checks(ControlFlowNode node, boolean branch) {
|
||||||
node = this.(CallNode).getNode().getFunc().(Attribute).getObject().getAFlowNode() and
|
node = attr.getObject().getAFlowNode() and
|
||||||
branch = true
|
branch = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user