Python: PathCheck StartswithCall

Should this use `Value::named`?
This commit is contained in:
Rasmus Lerchedahl Petersen
2020-10-22 11:34:07 +02:00
parent 6e361c7793
commit 391925532d

View File

@@ -734,3 +734,12 @@ private class OpenCall extends FileSystemAccess::Range, DataFlow::CfgNode {
result.asCfgNode() in [node.getArg(0), node.getArgByName("file")]
}
}
private class StartswithCall extends PathCheck::Range {
StartswithCall() { this.(CallNode).getFunction().(AttrNode).getName() = "startswith" }
override predicate checks(ControlFlowNode node, boolean branch) {
node = this.(CallNode).getFunction().(AttrNode).getObject() and
branch = true
}
}