Skip to content

Commit a16d58d

Browse files
committed
Python: Add tests cases with synthetic arguments
1 parent e391356 commit a16d58d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

python/ql/test/experimental/dataflow/consistency/dataflow-consistency.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
uniqueEnclosingCallable
2+
| test.py:239:27:239:27 | ControlFlowNode for p | Node should have one enclosing callable but has 0. |
3+
| test.py:245:5:245:22 | PosOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
4+
| test.py:248:5:248:26 | KwOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
5+
| test.py:251:5:251:33 | KwOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
26
uniqueType
37
uniqueNodeLocation
48
missingLocation

python/ql/test/experimental/dataflow/consistency/test.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,17 @@ def non_const_eq_preserves_taint(x):
235235
SINK(tainted) # unsafe
236236
if tainted == x:
237237
SINK(tainted) # unsafe
238+
239+
def overflowCallee(*args, p="", **kwargs):
240+
print("args", args)
241+
print("p", p)
242+
print("kwargs", kwargs)
243+
244+
def synth_arg_posOverflow():
245+
overflowCallee(42)
246+
247+
def synth_arg_kwOverflow():
248+
overflowCallee(foo=42)
249+
250+
def synth_arg_kwUnpacked():
251+
overflowCallee(**{"p": "42"})

0 commit comments

Comments
 (0)