File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
python/ql/test/experimental/meta/inline-taint-test-demo Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 11argumentToEnsureNotTaintedNotMarkedAsSpurious
2- | ERROR, you should add `SPURIOUS:` to this annotation | taint_test.py:36 :9:36 :29 | taint_test.py:36 | should_not_be_tainted |
2+ | ERROR, you should add `SPURIOUS:` to this annotation | taint_test.py:48 :9:48 :29 | taint_test.py:48 | should_not_be_tainted |
33untaintedArgumentToEnsureTaintedNotMarkedAsMissing
4- | ERROR, you should add `# $ MISSING: tainted` annotation | taint_test.py:28:9:28:25 | taint_test.py:28 |
4+ | ERROR, you should add `# $ MISSING: tainted` annotation | taint_test.py:32:9:32:25 | taint_test.py:32 |
5+ | ERROR, you should add `# $ MISSING: tainted` annotation | taint_test.py:37:24:37:40 | taint_test.py:37 |
56failures
7+ | taint_test.py:41:20:41:21 | ts | Fixed missing result:tainted= |
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ def expected_usage():
99 should_be_tainted , # $ MISSING: tainted
1010 )
1111
12+ # having one annotation for multiple arguments is OK, as long as all arguments
13+ # fulfil the same annotation
14+ ensure_tainted (ts , ts ) # $ tainted
15+
1216 # simulating handling something we _want_ to treat at untainted, but we currently treat as tainted
1317 should_not_be_tainted = "pretend this is now safe" + ts
1418 ensure_not_tainted (
@@ -28,6 +32,14 @@ def bad_usage():
2832 should_be_tainted ,
2933 )
3034
35+ # using one annotation for multiple arguments i not OK when it's mixed whether our
36+ # taint-tracking works as expected
37+ ensure_tainted (ts , should_be_tainted ) # $ tainted
38+
39+ # if you try to get around it by adding BOTH annotations, that results in a problem
40+ # from the default set of inline-test-expectation rules
41+ ensure_tainted (ts , should_be_tainted ) # $ tainted MISSING: tainted
42+
3143 # simulating handling something we _want_ to treat at untainted, but we currently treat as tainted
3244 should_not_be_tainted = "pretend this is now safe" + ts
3345
You can’t perform that action at this time.
0 commit comments