Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b4b01a commit 52cd7f2Copy full SHA for 52cd7f2
1 file changed
python/ql/test/library-tests/dataflow/global-or-captured-vars/test.py
@@ -85,4 +85,34 @@ def baz7(loc_foo):
85
86
threading.Thread(target=bar7).start()
87
88
-baz7(foo7)
+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
112
+ ensure_tainted(foo9[0]) # $tainted
113
114
+ def baz9(loc_foo):
115
116
117
+ baz9(foo9)
118
+ bar9()
0 commit comments