File tree 2 files changed +8
-27
lines changed
python/ql/test/experimental/dataflow/regression
2 files changed +8
-27
lines changed Original file line number Diff line number Diff line change 10
10
| test.py:76:9:76:14 | ControlFlowNode for SOURCE | test.py:78:10:78:10 | ControlFlowNode for t |
11
11
| test.py:128:13:128:18 | ControlFlowNode for SOURCE | test.py:132:14:132:14 | ControlFlowNode for t |
12
12
| test.py:159:10:159:15 | ControlFlowNode for SOURCE | test.py:160:14:160:14 | ControlFlowNode for t |
13
- | test.py:163:9:163:14 | ControlFlowNode for SOURCE | test.py:165:10 :165:10 | ControlFlowNode for s |
13
+ | test.py:163:9:163:14 | ControlFlowNode for SOURCE | test.py:165:12 :165:12 | ControlFlowNode for s |
14
14
| test.py:178:9:178:14 | ControlFlowNode for SOURCE | test.py:180:14:180:14 | ControlFlowNode for t |
15
- | test.py:178:9:178:14 | ControlFlowNode for SOURCE | test.py:182:14 :182:14 | ControlFlowNode for t |
16
- | test.py:178:9:178:14 | ControlFlowNode for SOURCE | test.py:184:14 :184:14 | ControlFlowNode for t |
15
+ | test.py:178:9:178:14 | ControlFlowNode for SOURCE | test.py:182:16 :182:16 | ControlFlowNode for t |
16
+ | test.py:178:9:178:14 | ControlFlowNode for SOURCE | test.py:184:16 :184:16 | ControlFlowNode for t |
17
17
| test.py:178:9:178:14 | ControlFlowNode for SOURCE | test.py:186:14:186:14 | ControlFlowNode for t |
18
18
| test.py:195:9:195:14 | ControlFlowNode for SOURCE | test.py:197:14:197:14 | ControlFlowNode for t |
19
19
| test.py:195:9:195:14 | ControlFlowNode for SOURCE | test.py:199:14:199:14 | ControlFlowNode for t |
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ def test7(cond):
40
40
if cond :
41
41
SINK (t )
42
42
43
- def source2 (arg ):
44
- return source (arg )
43
+ def source2 ():
44
+ return source ()
45
45
46
46
def sink2 (arg ):
47
47
sink (arg )
@@ -50,7 +50,7 @@ def sink3(cond, arg):
50
50
if cond :
51
51
sink (arg )
52
52
53
- def test8 (cond ): # This flow is shadowed by previous tests, perhaps do a path query
53
+ def test8 (cond ): # This test currently adds nothing, as we only track SOURCE -> SINK, and previous tests already add flow from line 10 to line 13
54
54
t = source2 ()
55
55
sink2 (t )
56
56
@@ -201,8 +201,8 @@ def flow_through_type_test_if_no_class():
201
201
def flow_in_iteration ():
202
202
t = ITERABLE_SOURCE # Seems to not be sunk anywhere
203
203
for i in t :
204
- i
205
- return i
204
+ SINK ( i )
205
+ SINK ( i )
206
206
207
207
def flow_in_generator ():
208
208
seq = [SOURCE ]
@@ -212,22 +212,3 @@ def flow_in_generator():
212
212
def flow_from_generator ():
213
213
for x in flow_in_generator ():
214
214
SINK (x ) # Flow not found
215
-
216
- def const_eq_clears_taint ():
217
- tainted = SOURCE
218
- if tainted == "safe" :
219
- SINK (tainted ) # safe # FP
220
- SINK (tainted ) # unsafe
221
-
222
- def const_eq_clears_taint2 ():
223
- tainted = SOURCE
224
- if tainted != "safe" :
225
- return
226
- SINK (tainted ) # safe # FP
227
-
228
- def non_const_eq_preserves_taint (x ):
229
- tainted = SOURCE
230
- if tainted == tainted :
231
- SINK (tainted ) # unsafe
232
- if tainted == x :
233
- SINK (tainted ) # unsafe
You can’t perform that action at this time.
0 commit comments