From 1bd4aeebadab8df5dbe0d5908d1518482b7203fe Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 15 Aug 2019 13:59:44 +0100 Subject: [PATCH] CPP: Effects of #1715. --- .../dataflow/taint-tests/localTaint.expected | 13 ++++++++++--- .../library-tests/dataflow/taint-tests/taint.cpp | 2 +- .../dataflow/taint-tests/taint.expected | 7 +++++++ .../dataflow/taint-tests/test_diff.expected | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected index 58fb4b12ece..373eae70e68 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected @@ -5,6 +5,11 @@ | file://:0:0:0:0 | this | file://:0:0:0:0 | t | TAINT | | file://:0:0:0:0 | this | file://:0:0:0:0 | t | TAINT | | file://:0:0:0:0 | this | file://:0:0:0:0 | this | | +| file://:0:0:0:0 | this | file://:0:0:0:0 | this | | +| file://:0:0:0:0 | this | file://:0:0:0:0 | this | | +| file://:0:0:0:0 | this | file://:0:0:0:0 | this | | +| file://:0:0:0:0 | this | file://:0:0:0:0 | this | | +| file://:0:0:0:0 | this | file://:0:0:0:0 | this | | | file://:0:0:0:0 | this | file://:0:0:0:0 | u | TAINT | | file://:0:0:0:0 | this | file://:0:0:0:0 | u | TAINT | | file://:0:0:0:0 | this | file://:0:0:0:0 | u | TAINT | @@ -211,16 +216,21 @@ | taint.cpp:228:11:232:2 | {...} | taint.cpp:228:11:232:2 | [...](...){...} | TAINT | | taint.cpp:228:12:228:12 | t | taint.cpp:228:11:232:2 | {...} | TAINT | | taint.cpp:228:15:228:15 | u | taint.cpp:228:11:232:2 | {...} | TAINT | +| taint.cpp:228:17:228:17 | `this` parameter in operator() | file://:0:0:0:0 | this | | +| taint.cpp:228:17:228:17 | `this` parameter in operator() | file://:0:0:0:0 | this | | | taint.cpp:235:11:235:11 | Unknown literal | taint.cpp:235:11:235:11 | constructor init of field t | TAINT | | taint.cpp:235:11:235:11 | Unknown literal | taint.cpp:235:11:235:11 | constructor init of field u | TAINT | | taint.cpp:235:11:235:11 | Unknown literal | taint.cpp:235:11:235:11 | constructor init of field v | TAINT | | taint.cpp:235:11:239:2 | [...](...){...} | taint.cpp:240:2:240:2 | b | | | taint.cpp:235:11:239:2 | {...} | taint.cpp:235:11:239:2 | [...](...){...} | TAINT | +| taint.cpp:235:15:235:15 | `this` parameter in operator() | file://:0:0:0:0 | this | | | taint.cpp:238:7:238:12 | call to source | taint.cpp:238:3:238:14 | ... = ... | | | taint.cpp:243:11:243:11 | Unknown literal | taint.cpp:243:11:243:11 | constructor init of field t | TAINT | | taint.cpp:243:11:243:11 | Unknown literal | taint.cpp:243:11:243:11 | constructor init of field u | TAINT | | taint.cpp:243:11:246:2 | [...](...){...} | taint.cpp:247:2:247:2 | c | | | taint.cpp:243:11:246:2 | {...} | taint.cpp:243:11:246:2 | [...](...){...} | TAINT | +| taint.cpp:243:15:243:15 | `this` parameter in operator() | file://:0:0:0:0 | this | | +| taint.cpp:243:15:243:15 | `this` parameter in operator() | file://:0:0:0:0 | this | | | taint.cpp:249:11:252:2 | [...](...){...} | taint.cpp:253:2:253:2 | d | | | taint.cpp:249:18:249:18 | a | taint.cpp:250:8:250:8 | a | | | taint.cpp:249:25:249:25 | b | taint.cpp:251:8:251:8 | b | | @@ -228,7 +238,4 @@ | taint.cpp:255:19:255:19 | a | taint.cpp:256:8:256:8 | a | | | taint.cpp:255:27:255:27 | b | taint.cpp:257:8:257:8 | b | | | taint.cpp:258:7:258:12 | call to source | taint.cpp:258:3:258:14 | ... = ... | | -| taint.cpp:260:4:260:4 | ref arg t | taint.cpp:260:4:260:4 | t | | -| taint.cpp:260:7:260:7 | ref arg u | taint.cpp:260:7:260:7 | u | | -| taint.cpp:260:10:260:10 | ref arg w | taint.cpp:260:10:260:10 | w | | | taint.cpp:260:10:260:10 | ref arg w | taint.cpp:261:7:261:7 | w | | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp b/cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp index 7be8038fe9f..7c1ae15820d 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp @@ -230,7 +230,7 @@ void test_lambdas() sink(u); return t; }; - sink(a()); // tainted [NOT DETECTED] + sink(a()); // tainted auto b = [&] { sink(t); // tainted [NOT DETECTED] diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected index 1810662ecf3..c17e1d6e634 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected @@ -1,3 +1,9 @@ +| file://:0:0:0:0 | t | taint.cpp:223:10:223:15 | call to source | +| file://:0:0:0:0 | t | taint.cpp:223:10:223:15 | call to source | +| file://:0:0:0:0 | t | taint.cpp:223:10:223:15 | call to source | +| file://:0:0:0:0 | u | taint.cpp:223:10:223:15 | call to source | +| file://:0:0:0:0 | u | taint.cpp:223:10:223:15 | call to source | +| file://:0:0:0:0 | u | taint.cpp:223:10:223:15 | call to source | | taint.cpp:8:8:8:13 | clean1 | taint.cpp:4:27:4:33 | source1 | | taint.cpp:16:8:16:14 | source1 | taint.cpp:12:22:12:27 | call to source | | taint.cpp:17:8:17:16 | ++ ... | taint.cpp:12:22:12:27 | call to source | @@ -20,5 +26,6 @@ | taint.cpp:210:7:210:7 | x | taint.cpp:207:6:207:11 | call to source | | taint.cpp:215:7:215:7 | x | taint.cpp:207:6:207:11 | call to source | | taint.cpp:216:7:216:7 | y | taint.cpp:207:6:207:11 | call to source | +| taint.cpp:233:8:233:8 | call to operator() | taint.cpp:223:10:223:15 | call to source | | taint.cpp:250:8:250:8 | a | taint.cpp:223:10:223:15 | call to source | | taint.cpp:256:8:256:8 | a | taint.cpp:223:10:223:15 | call to source | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected index dec5d64f507..2c5d32f0f7b 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected @@ -1,3 +1,4 @@ +| file://:0:0:0:0 | taint.cpp:223:10:223:15 | AST only | | taint.cpp:41:7:41:13 | taint.cpp:35:12:35:17 | AST only | | taint.cpp:42:7:42:13 | taint.cpp:35:12:35:17 | AST only | | taint.cpp:43:7:43:13 | taint.cpp:37:22:37:27 | AST only | @@ -12,5 +13,6 @@ | taint.cpp:195:7:195:7 | taint.cpp:193:6:193:6 | AST only | | taint.cpp:215:7:215:7 | taint.cpp:207:6:207:11 | AST only | | taint.cpp:216:7:216:7 | taint.cpp:207:6:207:11 | AST only | +| taint.cpp:233:8:233:8 | taint.cpp:223:10:223:15 | AST only | | taint.cpp:250:8:250:8 | taint.cpp:223:10:223:15 | AST only | | taint.cpp:256:8:256:8 | taint.cpp:223:10:223:15 | AST only |