Python: Add tests cases with synthetic arguments

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-12-18 10:36:55 +01:00
parent e391356893
commit a16d58dfc0
2 changed files with 18 additions and 0 deletions

View File

@@ -1,4 +1,8 @@
uniqueEnclosingCallable
| test.py:239:27:239:27 | ControlFlowNode for p | Node should have one enclosing callable but has 0. |
| test.py:245:5:245:22 | PosOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
| test.py:248:5:248:26 | KwOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
| test.py:251:5:251:33 | KwOverflowNode for overflowCallee() | Node should have one enclosing callable but has 0. |
uniqueType
uniqueNodeLocation
missingLocation

View File

@@ -235,3 +235,17 @@ def non_const_eq_preserves_taint(x):
SINK(tainted) # unsafe
if tainted == x:
SINK(tainted) # unsafe
def overflowCallee(*args, p="", **kwargs):
print("args", args)
print("p", p)
print("kwargs", kwargs)
def synth_arg_posOverflow():
overflowCallee(42)
def synth_arg_kwOverflow():
overflowCallee(foo=42)
def synth_arg_kwUnpacked():
overflowCallee(**{"p": "42"})