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():
8585 else :
8686 ensure_tainted (ts ) # $ tainted
8787
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+
88109
89110SAFE = ["safe" , "also_safe" ]
90111
@@ -184,6 +205,9 @@ def test_eq_thorugh_func():
184205test_in_set ()
185206test_in_local_variable ()
186207test_in_global_variable ()
208+ test_is_none ()
209+ test_is_not_none ()
210+ test_in_list_with_constants ()
187211make_modification ("unsafe" )
188212test_in_modified_global_variable ()
189213test_in_unsafe1 (["unsafe" , "foo" ])
You can’t perform that action at this time.
0 commit comments