Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e187a5

Browse files
author
Robert Marsh
committed
C++: test for interprocedurl iterator flow
1 parent eab1557 commit 2e187a5

4 files changed

Lines changed: 4 additions & 12 deletions

File tree

cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,22 +3269,16 @@
32693269
| vector.cpp:350:38:350:39 | v4 | vector.cpp:350:41:350:45 | call to begin | TAINT |
32703270
| vector.cpp:350:41:350:45 | call to begin | vector.cpp:350:50:350:51 | it | |
32713271
| vector.cpp:350:41:350:45 | call to begin | vector.cpp:350:68:350:69 | it | |
3272-
| vector.cpp:350:41:350:45 | call to begin | vector.cpp:351:4:351:5 | it | |
3272+
| vector.cpp:350:41:350:45 | call to begin | vector.cpp:351:32:351:33 | it | |
32733273
| vector.cpp:350:56:350:57 | ref arg v4 | vector.cpp:350:56:350:57 | v4 | |
32743274
| vector.cpp:350:56:350:57 | ref arg v4 | vector.cpp:353:7:353:8 | v4 | |
32753275
| vector.cpp:350:56:350:57 | ref arg v4 | vector.cpp:382:1:382:1 | v4 | |
32763276
| vector.cpp:350:56:350:57 | v4 | vector.cpp:350:59:350:61 | call to end | TAINT |
32773277
| vector.cpp:350:68:350:69 | it | vector.cpp:350:66:350:66 | call to operator++ | TAINT |
32783278
| vector.cpp:350:68:350:69 | ref arg it | vector.cpp:350:50:350:51 | it | |
32793279
| vector.cpp:350:68:350:69 | ref arg it | vector.cpp:350:68:350:69 | it | |
3280-
| vector.cpp:350:68:350:69 | ref arg it | vector.cpp:351:4:351:5 | it | |
3281-
| vector.cpp:351:3:351:3 | call to operator* [post update] | vector.cpp:350:56:350:57 | v4 | |
3282-
| vector.cpp:351:3:351:3 | call to operator* [post update] | vector.cpp:353:7:353:8 | v4 | |
3283-
| vector.cpp:351:3:351:3 | call to operator* [post update] | vector.cpp:382:1:382:1 | v4 | |
3284-
| vector.cpp:351:3:351:16 | ... = ... | vector.cpp:351:3:351:3 | call to operator* [post update] | |
3285-
| vector.cpp:351:4:351:5 | it | vector.cpp:351:3:351:3 | call to operator* | TAINT |
3286-
| vector.cpp:351:9:351:14 | call to source | vector.cpp:351:3:351:3 | call to operator* [post update] | TAINT |
3287-
| vector.cpp:351:9:351:14 | call to source | vector.cpp:351:3:351:16 | ... = ... | |
3280+
| vector.cpp:350:68:350:69 | ref arg it | vector.cpp:351:32:351:33 | it | |
3281+
| vector.cpp:351:32:351:33 | it | vector.cpp:351:32:351:33 | call to iterator | |
32883282
| vector.cpp:353:7:353:8 | ref arg v4 | vector.cpp:382:1:382:1 | v4 | |
32893283
| vector.cpp:355:34:355:35 | ref arg v5 | vector.cpp:357:7:357:8 | v5 | |
32903284
| vector.cpp:355:34:355:35 | ref arg v5 | vector.cpp:359:7:359:8 | v5 | |

cpp/ql/test/library-tests/dataflow/taint-tests/taint.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@
328328
| vector.cpp:326:7:326:8 | v4 | vector.cpp:318:15:318:20 | call to source |
329329
| vector.cpp:338:7:338:8 | v1 | vector.cpp:337:8:337:13 | call to source |
330330
| vector.cpp:343:7:343:8 | v2 | vector.cpp:341:9:341:14 | call to source |
331-
| vector.cpp:353:7:353:8 | v4 | vector.cpp:351:9:351:14 | call to source |
332331
| vector.cpp:357:7:357:8 | v5 | vector.cpp:356:8:356:13 | call to source |
333332
| vector.cpp:359:7:359:8 | v5 | vector.cpp:356:8:356:13 | call to source |
334333
| vector.cpp:363:7:363:8 | v6 | vector.cpp:362:8:362:13 | call to source |

cpp/ql/test/library-tests/dataflow/taint-tests/test_diff.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@
277277
| vector.cpp:326:7:326:8 | vector.cpp:318:15:318:20 | AST only |
278278
| vector.cpp:338:7:338:8 | vector.cpp:337:8:337:13 | AST only |
279279
| vector.cpp:343:7:343:8 | vector.cpp:341:9:341:14 | AST only |
280-
| vector.cpp:353:7:353:8 | vector.cpp:351:9:351:14 | AST only |
281280
| vector.cpp:357:7:357:8 | vector.cpp:356:8:356:13 | AST only |
282281
| vector.cpp:359:7:359:8 | vector.cpp:356:8:356:13 | AST only |
283282
| vector.cpp:363:7:363:8 | vector.cpp:362:8:362:13 | AST only |

cpp/ql/test/library-tests/dataflow/taint-tests/vector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void test_vector_output_iterator(int b) {
348348
sink(v3); // tainted [NOT DETECTED]
349349

350350
for(std::vector<int>::iterator it = v4.begin(); it != v4.end(); ++it) {
351-
*it = source();
351+
taint_vector_output_iterator(it);
352352
}
353353
sink(v4); // tainted [NOT DETECTED by IR]
354354

0 commit comments

Comments
 (0)