Python: Add BarrierGuard test with exception inside unsafe branch

This commit is contained in:
Rasmus Wriedt Larsen
2020-11-20 11:55:07 +01:00
parent 34f78d4211
commit 08bcba98e6
2 changed files with 13 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ test_taint
| test_logical.py:126 | ok | test_nesting_not_with_and_true | s |
| test_logical.py:128 | ok | test_nesting_not_with_and_true | s |
| test_logical.py:137 | fail | test_with_return | s |
| test_logical.py:146 | fail | test_with_exception | s |
isSanitizer
| TestTaintTrackingConfiguration | test.py:21:39:21:39 | ControlFlowNode for s |
| TestTaintTrackingConfiguration | test.py:50:10:50:29 | ControlFlowNode for emulated_escaping() |

View File

@@ -137,6 +137,14 @@ def test_with_return():
ensure_not_tainted(s)
def test_with_exception():
s = TAINTED_STRING
if not is_safe(s):
raise Exception("unsafe")
ensure_not_tainted(s)
# Make tests runable
test_basic()
@@ -146,3 +154,7 @@ test_tricky()
test_nesting_not()
test_nesting_not_with_and_true()
test_with_return()
try:
test_with_exception()
except:
pass