File tree Expand file tree Collapse file tree
python/ql/test/experimental/dataflow/tainttracking/commonSanitizer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22| test_string_eq.py:18 | ok | const_eq_clears_taint | ts |
33| test_string_eq.py:20 | ok | const_eq_clears_taint | ts |
44| test_string_eq.py:27 | fail | const_eq_clears_taint2 | ts |
5- | test_string_eq.py:33 | ok | non_const_eq_preserves_taint | ts |
6- | test_string_eq.py:35 | ok | non_const_eq_preserves_taint | ts |
7- | test_string_eq.py:45 | fail | const_eq_through_func | ts |
8- | test_string_eq.py:47 | ok | const_eq_through_func | ts |
9- | test_string_eq.py:49 | ok | const_eq_through_func | ts |
5+ | test_string_eq.py:33 | fail | const_eq_clears_taint3 | ts |
6+ | test_string_eq.py:35 | ok | const_eq_clears_taint3 | ts |
7+ | test_string_eq.py:41 | ok | non_const_eq_preserves_taint | ts |
8+ | test_string_eq.py:43 | ok | non_const_eq_preserves_taint | ts |
9+ | test_string_eq.py:53 | fail | const_eq_through_func | ts |
10+ | test_string_eq.py:55 | ok | const_eq_through_func | ts |
11+ | test_string_eq.py:57 | ok | const_eq_through_func | ts |
Original file line number Diff line number Diff line change @@ -27,6 +27,14 @@ def const_eq_clears_taint2():
2727 ensure_not_tainted (ts )
2828
2929
30+ def const_eq_clears_taint3 ():
31+ ts = TAINTED_STRING
32+ if ts == "safe" or ts == "also_safe" :
33+ ensure_not_tainted (ts )
34+ else :
35+ ensure_tainted (ts )
36+
37+
3038def non_const_eq_preserves_taint (x = "foo" ):
3139 ts = TAINTED_STRING
3240 if ts == ts :
@@ -53,4 +61,5 @@ def const_eq_through_func():
5361
5462const_eq_clears_taint ()
5563const_eq_clears_taint2 ()
64+ const_eq_clears_taint3 ()
5665non_const_eq_preserves_taint ()
You can’t perform that action at this time.
0 commit comments