mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
Merge pull request #1713 from markshannon/python-remove-parents
Python taint-tracking: Remove 'parents' query from path-queries.
This commit is contained in:
@@ -7,21 +7,3 @@ query predicate edges(TaintedNode fromnode, TaintedNode tonode) {
|
||||
/* Don't record flow past sinks */
|
||||
not fromnode.isSink()
|
||||
}
|
||||
|
||||
private TaintedNode first_child(TaintedNode parent) {
|
||||
result.getContext().getCaller() = parent.getContext() and
|
||||
edges(parent, result)
|
||||
}
|
||||
|
||||
private TaintedNode next_sibling(TaintedNode child) {
|
||||
edges(child, result) and
|
||||
child.getContext() = result.getContext()
|
||||
}
|
||||
|
||||
query predicate parents(TaintedNode child, TaintedNode parent) {
|
||||
child = first_child(parent) or
|
||||
exists(TaintedNode prev |
|
||||
parents(prev, parent) and
|
||||
child = next_sibling(prev)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user