File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
python/ql/test/library-tests/dataflow/tainttracking/commonSanitizer Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,27 @@ def test_in_local_variable():
85
85
else :
86
86
ensure_tainted (ts ) # $ tainted
87
87
88
+ def test_is_none ():
89
+ ts = TAINTED_STRING
90
+ if ts is None :
91
+ ensure_not_tainted (ts )
92
+ else :
93
+ ensure_tainted (ts ) # $ tainted
94
+
95
+ def test_is_not_none ():
96
+ ts = TAINTED_STRING
97
+ if ts is not None :
98
+ ensure_tainted (ts ) # $ tainted
99
+ else :
100
+ ensure_not_tainted (ts )
101
+
102
+ def test_in_list_with_constants ():
103
+ ts = TAINTED_STRING
104
+ if ts in ["safe" , None , 3 , False ]:
105
+ ensure_not_tainted (ts )
106
+ else :
107
+ ensure_tainted (ts ) # $ tainted
108
+
88
109
89
110
SAFE = ["safe" , "also_safe" ]
90
111
@@ -184,6 +205,9 @@ def test_eq_thorugh_func():
184
205
test_in_set ()
185
206
test_in_local_variable ()
186
207
test_in_global_variable ()
208
+ test_is_none ()
209
+ test_is_not_none ()
210
+ test_in_list_with_constants ()
187
211
make_modification ("unsafe" )
188
212
test_in_modified_global_variable ()
189
213
test_in_unsafe1 (["unsafe" , "foo" ])
You can’t perform that action at this time.
0 commit comments