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 1
1
argumentToEnsureNotTaintedNotMarkedAsSpurious
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 |
3
3
untaintedArgumentToEnsureTaintedNotMarkedAsMissing
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 |
5
6
failures
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():
9
9
should_be_tainted , # $ MISSING: tainted
10
10
)
11
11
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
+
12
16
# simulating handling something we _want_ to treat at untainted, but we currently treat as tainted
13
17
should_not_be_tainted = "pretend this is now safe" + ts
14
18
ensure_not_tainted (
@@ -28,6 +32,14 @@ def bad_usage():
28
32
should_be_tainted ,
29
33
)
30
34
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
+
31
43
# simulating handling something we _want_ to treat at untainted, but we currently treat as tainted
32
44
should_not_be_tainted = "pretend this is now safe" + ts
33
45
You can’t perform that action at this time.
0 commit comments