Skip to content

Commit d607c13

Browse files
committed
Python: Taint tests: include elment for forgotten MISSING
1 parent 9585390 commit d607c13

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

python/ql/test/experimental/meta/InlineTaintTest.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,13 @@ query predicate argumentToEnsureNotTaintedNotMarkedAsSpurious(
7878
)
7979
}
8080

81-
query predicate untaintedArgumentToEnsureTaintedNotMarkedAsMissing(Location location, string error) {
81+
query predicate untaintedArgumentToEnsureTaintedNotMarkedAsMissing(
82+
Location location, string error, string element
83+
) {
8284
error = "ERROR, you should add `# $ MISSING: tainted` annotation" and
8385
exists(DataFlow::Node sink |
8486
sink = shouldBeTainted() and
87+
element = prettyExp(sink.asExpr()) and
8588
not any(TestTaintTrackingConfiguration config).hasFlow(_, sink) and
8689
location = sink.getLocation() and
8790
not exists(FalseNegativeExpectation missingResult |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
argumentToEnsureNotTaintedNotMarkedAsSpurious
22
| taint_test.py:48:9:48:29 | taint_test.py:48 | ERROR, you should add `SPURIOUS:` to this annotation | should_not_be_tainted |
33
untaintedArgumentToEnsureTaintedNotMarkedAsMissing
4-
| taint_test.py:32:9:32:25 | taint_test.py:32 | ERROR, you should add `# $ MISSING: tainted` annotation |
5-
| taint_test.py:37:24:37:40 | taint_test.py:37 | ERROR, you should add `# $ MISSING: tainted` annotation |
4+
| taint_test.py:32:9:32:25 | taint_test.py:32 | ERROR, you should add `# $ MISSING: tainted` annotation | should_be_tainted |
5+
| taint_test.py:37:24:37:40 | taint_test.py:37 | ERROR, you should add `# $ MISSING: tainted` annotation | should_be_tainted |
66
failures
77
| taint_test.py:41:20:41:21 | ts | Fixed missing result:tainted= |

0 commit comments

Comments
 (0)