File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
python/ql/test/library-tests/dataflow/global-or-captured-vars Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -85,4 +85,34 @@ def baz7(loc_foo):
85
85
86
86
threading .Thread (target = bar7 ).start ()
87
87
88
- baz7 (foo7 )
88
+ baz7 (foo7 )
89
+
90
+ # Test 8
91
+ # FN - Flow is also *not* found in the above case through a direct call
92
+
93
+ foo8 = []
94
+
95
+ def bar8 ():
96
+ time .sleep (1 )
97
+ ensure_tainted (foo8 [0 ]) # $MISSING: tainted
98
+
99
+ def baz8 (loc_foo ):
100
+ loc_foo .append (TAINTED_STRING )
101
+
102
+ baz8 (foo8 )
103
+ bar8 ()
104
+
105
+ # Test 9
106
+ # TP - Flow is found in the above case when the variable is captured rather than global
107
+
108
+ def test9 ():
109
+ foo9 = []
110
+ def bar9 ():
111
+ time .sleep (1 )
112
+ ensure_tainted (foo9 [0 ]) # $tainted
113
+
114
+ def baz9 (loc_foo ):
115
+ loc_foo .append (TAINTED_STRING )
116
+
117
+ baz9 (foo9 )
118
+ bar9 ()
You can’t perform that action at this time.
0 commit comments