Skip to content

Commit f9d7bec

Browse files
committed
Python: Make multipleArgumentCallExclude more specific
1 parent 2ec1822 commit f9d7bec

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

python/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,16 @@ private module Input implements InputSig<PythonDataFlow> {
5050
}
5151

5252
predicate multipleArgumentCallExclude(ArgumentNode arg, DataFlowCall call) {
53-
isArgumentNode(arg, call, _)
53+
// since we can have multiple DataFlowCall for a CallNode (for example if can
54+
// resolve to multiple functions), but we only make _one_ ArgumentNode for each
55+
// argument in the CallNode, we end up violating this consistency check in those
56+
// cases. (see `getCallArg` in DataFlowDispatch.qll)
57+
exists(DataFlowCall other, CallNode cfgCall | other != call |
58+
call.getNode() = cfgCall and
59+
other.getNode() = cfgCall and
60+
isArgumentNode(arg, call, _) and
61+
isArgumentNode(arg, other, _)
62+
)
5463
}
5564
}
5665

0 commit comments

Comments
 (0)