diff --git a/graphs/dfg.ql b/graphs/dfg.ql index 70ddba4..c3aa88f 100644 --- a/graphs/dfg.ql +++ b/graphs/dfg.ql @@ -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 ) }