mirror of
https://github.com/hohn/codeql-workshop-dataflow-c.git
synced 2025-12-16 02:33:03 +01:00
simplify graph
This commit is contained in:
@@ -21,10 +21,12 @@ query predicate nodes(DataFlow::Node n1, string key, string value) {
|
||||
}
|
||||
|
||||
query predicate edges(DataFlow::Node n1, DataFlow::Node n2) {
|
||||
exists(Function f1 |
|
||||
f1.hasName("copy_mem") and
|
||||
n1.getFunction() = f1 and
|
||||
// Find all nodes that flow into the conditional expression of an if-statement.
|
||||
exists(ConditionalStmt cond, DataFlow::Node n3 |
|
||||
cond.getControllingExpr().getAChild() = n3.asExpr() and
|
||||
DataFlow::localFlow(n1, n3) and
|
||||
DataFlow::localFlowStep(n1, n2) and
|
||||
n1 != n2 and
|
||||
n2.getLocation().getStartLine() < 46
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user