mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: Move library to correct location.
This commit is contained in:
25
python/ql/src/semmle/python/security/Paths.qll
Normal file
25
python/ql/src/semmle/python/security/Paths.qll
Normal file
@@ -0,0 +1,25 @@
|
||||
import python
|
||||
|
||||
import semmle.python.security.TaintTracking
|
||||
|
||||
query predicate edges(TaintedNode fromnode, TaintedNode tonode) {
|
||||
fromnode.getASuccessor() = tonode
|
||||
}
|
||||
|
||||
private TaintedNode first_child(TaintedNode parent) {
|
||||
result.getContext().getCaller() = parent.getContext() and
|
||||
parent.getASuccessor() = result
|
||||
}
|
||||
|
||||
private TaintedNode next_sibling(TaintedNode child) {
|
||||
child.getASuccessor() = 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(child)
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user