Skip to content

Commit bb1c088

Browse files
committed
C++: Undo changes to iterator models.
1 parent c988547 commit bb1c088

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/Iterator.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private class IteratorCrementMemberOperator extends MemberFunction, DataFlowFunc
223223
output.isQualifierObject()
224224
or
225225
input.isQualifierObject() and
226-
output.isReturnValue()
226+
output.isReturnValueDeref()
227227
}
228228

229229
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {

cpp/ql/lib/semmle/code/cpp/models/implementations/StdString.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private class StdStringAppend extends TaintFunction {
176176
) and
177177
(
178178
output.isQualifierObject() or
179-
output.isReturnValue()
179+
output.isReturnValueDeref()
180180
)
181181
or
182182
// reverse flow from returned reference to the qualifier (for writes to

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3488,7 +3488,7 @@
34883488
| standalone_iterators.cpp:41:19:41:19 | call to operator++ | standalone_iterators.cpp:41:10:41:10 | call to operator* | TAINT |
34893489
| standalone_iterators.cpp:42:12:42:12 | call to operator++ | standalone_iterators.cpp:42:10:42:10 | call to operator* | TAINT |
34903490
| standalone_iterators.cpp:42:14:42:20 | ref arg source1 | standalone_iterators.cpp:39:45:39:51 | source1 | |
3491-
| standalone_iterators.cpp:42:14:42:20 | source1 | standalone_iterators.cpp:42:12:42:12 | call to operator++ | TAINT |
3491+
| standalone_iterators.cpp:42:14:42:20 | source1 | standalone_iterators.cpp:42:12:42:12 | call to operator++ | |
34923492
| standalone_iterators.cpp:45:39:45:45 | source1 | standalone_iterators.cpp:45:39:45:45 | source1 | |
34933493
| standalone_iterators.cpp:45:39:45:45 | source1 | standalone_iterators.cpp:46:11:46:17 | source1 | |
34943494
| standalone_iterators.cpp:45:39:45:45 | source1 | standalone_iterators.cpp:47:12:47:18 | source1 | |
@@ -3500,7 +3500,7 @@
35003500
| standalone_iterators.cpp:47:19:47:19 | call to operator++ | standalone_iterators.cpp:47:10:47:10 | call to operator* | TAINT |
35013501
| standalone_iterators.cpp:48:12:48:12 | call to operator++ | standalone_iterators.cpp:48:10:48:10 | call to operator* | TAINT |
35023502
| standalone_iterators.cpp:48:14:48:20 | ref arg source1 | standalone_iterators.cpp:45:39:45:45 | source1 | |
3503-
| standalone_iterators.cpp:48:14:48:20 | source1 | standalone_iterators.cpp:48:12:48:12 | call to operator++ | TAINT |
3503+
| standalone_iterators.cpp:48:14:48:20 | source1 | standalone_iterators.cpp:48:12:48:12 | call to operator++ | |
35043504
| standalone_iterators.cpp:51:37:51:43 | source1 | standalone_iterators.cpp:52:11:52:17 | source1 | |
35053505
| standalone_iterators.cpp:51:37:51:43 | source1 | standalone_iterators.cpp:53:12:53:18 | source1 | |
35063506
| standalone_iterators.cpp:51:37:51:43 | source1 | standalone_iterators.cpp:54:14:54:20 | source1 | |
@@ -3788,7 +3788,7 @@
37883788
| string.cpp:120:16:120:24 | call to basic_string | string.cpp:125:50:125:50 | s | |
37893789
| string.cpp:120:16:120:24 | call to basic_string | string.cpp:129:16:129:16 | s | |
37903790
| string.cpp:121:15:121:15 | (__begin) | string.cpp:121:15:121:15 | call to operator* | TAINT |
3791-
| string.cpp:121:15:121:15 | (__begin) | string.cpp:121:15:121:15 | call to operator++ | TAINT |
3791+
| string.cpp:121:15:121:15 | (__begin) | string.cpp:121:15:121:15 | call to operator++ | |
37923792
| string.cpp:121:15:121:15 | (__end) | string.cpp:121:15:121:15 | call to iterator | |
37933793
| string.cpp:121:15:121:15 | (__range) | string.cpp:121:15:121:15 | call to begin | TAINT |
37943794
| string.cpp:121:15:121:15 | (__range) | string.cpp:121:15:121:15 | call to end | TAINT |
@@ -3816,7 +3816,7 @@
38163816
| string.cpp:125:50:125:50 | ref arg s | string.cpp:125:50:125:50 | s | |
38173817
| string.cpp:125:50:125:50 | ref arg s | string.cpp:129:16:129:16 | s | |
38183818
| string.cpp:125:50:125:50 | s | string.cpp:125:52:125:54 | call to end | TAINT |
3819-
| string.cpp:125:61:125:62 | it | string.cpp:125:59:125:59 | call to operator++ | TAINT |
3819+
| string.cpp:125:61:125:62 | it | string.cpp:125:59:125:59 | call to operator++ | |
38203820
| string.cpp:125:61:125:62 | ref arg it | string.cpp:125:44:125:45 | it | |
38213821
| string.cpp:125:61:125:62 | ref arg it | string.cpp:125:61:125:62 | it | |
38223822
| string.cpp:125:61:125:62 | ref arg it | string.cpp:126:9:126:10 | it | |
@@ -3825,7 +3825,7 @@
38253825
| string.cpp:126:9:126:10 | ref arg it | string.cpp:125:61:125:62 | it | |
38263826
| string.cpp:126:9:126:10 | ref arg it | string.cpp:126:9:126:10 | it | |
38273827
| string.cpp:129:16:129:16 | (__begin) | string.cpp:129:16:129:16 | call to operator* | TAINT |
3828-
| string.cpp:129:16:129:16 | (__begin) | string.cpp:129:16:129:16 | call to operator++ | TAINT |
3828+
| string.cpp:129:16:129:16 | (__begin) | string.cpp:129:16:129:16 | call to operator++ | |
38293829
| string.cpp:129:16:129:16 | (__end) | string.cpp:129:16:129:16 | call to iterator | |
38303830
| string.cpp:129:16:129:16 | (__range) | string.cpp:129:16:129:16 | call to begin | TAINT |
38313831
| string.cpp:129:16:129:16 | (__range) | string.cpp:129:16:129:16 | call to end | TAINT |
@@ -3847,7 +3847,7 @@
38473847
| string.cpp:133:28:133:33 | call to source | string.cpp:133:28:133:36 | call to basic_string | TAINT |
38483848
| string.cpp:133:28:133:36 | call to basic_string | string.cpp:134:22:134:28 | const_s | |
38493849
| string.cpp:134:22:134:22 | (__begin) | string.cpp:134:22:134:22 | call to operator* | TAINT |
3850-
| string.cpp:134:22:134:22 | (__begin) | string.cpp:134:22:134:22 | call to operator++ | TAINT |
3850+
| string.cpp:134:22:134:22 | (__begin) | string.cpp:134:22:134:22 | call to operator++ | |
38513851
| string.cpp:134:22:134:22 | (__range) | string.cpp:134:22:134:22 | call to begin | TAINT |
38523852
| string.cpp:134:22:134:22 | (__range) | string.cpp:134:22:134:22 | call to end | TAINT |
38533853
| string.cpp:134:22:134:22 | call to begin | string.cpp:134:22:134:22 | (__begin) | |
@@ -4259,12 +4259,12 @@
42594259
| string.cpp:398:8:398:9 | i2 | string.cpp:399:12:399:13 | i3 | |
42604260
| string.cpp:399:10:399:10 | call to operator++ | string.cpp:399:8:399:8 | call to operator* | TAINT |
42614261
| string.cpp:399:10:399:10 | ref arg call to operator++ | string.cpp:399:12:399:13 | ref arg i3 | |
4262-
| string.cpp:399:12:399:13 | i3 | string.cpp:399:10:399:10 | call to operator++ | TAINT |
4262+
| string.cpp:399:12:399:13 | i3 | string.cpp:399:10:399:10 | call to operator++ | |
42634263
| string.cpp:400:8:400:9 | i2 | string.cpp:400:3:400:9 | ... = ... | |
42644264
| string.cpp:400:8:400:9 | i2 | string.cpp:401:12:401:13 | i4 | |
42654265
| string.cpp:401:10:401:10 | call to operator-- | string.cpp:401:8:401:8 | call to operator* | TAINT |
42664266
| string.cpp:401:10:401:10 | ref arg call to operator-- | string.cpp:401:12:401:13 | ref arg i4 | |
4267-
| string.cpp:401:12:401:13 | i4 | string.cpp:401:10:401:10 | call to operator-- | TAINT |
4267+
| string.cpp:401:12:401:13 | i4 | string.cpp:401:10:401:10 | call to operator-- | |
42684268
| string.cpp:402:8:402:9 | i2 | string.cpp:402:3:402:9 | ... = ... | |
42694269
| string.cpp:402:8:402:9 | i2 | string.cpp:403:3:403:4 | i5 | |
42704270
| string.cpp:402:8:402:9 | i2 | string.cpp:404:9:404:10 | i5 | |
@@ -4293,7 +4293,7 @@
42934293
| string.cpp:413:11:413:13 | call to end | string.cpp:413:3:413:15 | ... = ... | |
42944294
| string.cpp:413:11:413:13 | call to end | string.cpp:414:5:414:6 | i9 | |
42954295
| string.cpp:413:11:413:13 | call to end | string.cpp:415:9:415:10 | i9 | |
4296-
| string.cpp:414:5:414:6 | i9 | string.cpp:414:3:414:3 | call to operator-- | TAINT |
4296+
| string.cpp:414:5:414:6 | i9 | string.cpp:414:3:414:3 | call to operator-- | |
42974297
| string.cpp:414:5:414:6 | ref arg i9 | string.cpp:415:9:415:10 | i9 | |
42984298
| string.cpp:415:9:415:10 | i9 | string.cpp:415:8:415:8 | call to operator* | TAINT |
42994299
| string.cpp:417:9:417:10 | i2 | string.cpp:417:3:417:10 | ... = ... | |
@@ -6579,7 +6579,7 @@
65796579
| vector.cpp:17:21:17:33 | call to vector | vector.cpp:35:1:35:1 | v | |
65806580
| vector.cpp:17:26:17:32 | source1 | vector.cpp:17:21:17:33 | call to vector | TAINT |
65816581
| vector.cpp:19:14:19:14 | (__begin) | vector.cpp:19:14:19:14 | call to operator* | TAINT |
6582-
| vector.cpp:19:14:19:14 | (__begin) | vector.cpp:19:14:19:14 | call to operator++ | TAINT |
6582+
| vector.cpp:19:14:19:14 | (__begin) | vector.cpp:19:14:19:14 | call to operator++ | |
65836583
| vector.cpp:19:14:19:14 | (__end) | vector.cpp:19:14:19:14 | call to iterator | |
65846584
| vector.cpp:19:14:19:14 | (__range) | vector.cpp:19:14:19:14 | call to begin | TAINT |
65856585
| vector.cpp:19:14:19:14 | (__range) | vector.cpp:19:14:19:14 | call to end | TAINT |
@@ -6609,7 +6609,7 @@
66096609
| vector.cpp:23:55:23:55 | ref arg v | vector.cpp:27:15:27:15 | v | |
66106610
| vector.cpp:23:55:23:55 | ref arg v | vector.cpp:35:1:35:1 | v | |
66116611
| vector.cpp:23:55:23:55 | v | vector.cpp:23:57:23:59 | call to end | TAINT |
6612-
| vector.cpp:23:66:23:67 | it | vector.cpp:23:64:23:64 | call to operator++ | TAINT |
6612+
| vector.cpp:23:66:23:67 | it | vector.cpp:23:64:23:64 | call to operator++ | |
66136613
| vector.cpp:23:66:23:67 | ref arg it | vector.cpp:23:49:23:50 | it | |
66146614
| vector.cpp:23:66:23:67 | ref arg it | vector.cpp:23:66:23:67 | it | |
66156615
| vector.cpp:23:66:23:67 | ref arg it | vector.cpp:24:9:24:10 | it | |
@@ -6618,7 +6618,7 @@
66186618
| vector.cpp:24:9:24:10 | ref arg it | vector.cpp:23:66:23:67 | it | |
66196619
| vector.cpp:24:9:24:10 | ref arg it | vector.cpp:24:9:24:10 | it | |
66206620
| vector.cpp:27:15:27:15 | (__begin) | vector.cpp:27:15:27:15 | call to operator* | TAINT |
6621-
| vector.cpp:27:15:27:15 | (__begin) | vector.cpp:27:15:27:15 | call to operator++ | TAINT |
6621+
| vector.cpp:27:15:27:15 | (__begin) | vector.cpp:27:15:27:15 | call to operator++ | |
66226622
| vector.cpp:27:15:27:15 | (__end) | vector.cpp:27:15:27:15 | call to iterator | |
66236623
| vector.cpp:27:15:27:15 | (__range) | vector.cpp:27:15:27:15 | call to begin | TAINT |
66246624
| vector.cpp:27:15:27:15 | (__range) | vector.cpp:27:15:27:15 | call to end | TAINT |
@@ -6641,7 +6641,7 @@
66416641
| vector.cpp:31:33:31:45 | call to vector | vector.cpp:35:1:35:1 | const_v | |
66426642
| vector.cpp:31:38:31:44 | source1 | vector.cpp:31:33:31:45 | call to vector | TAINT |
66436643
| vector.cpp:32:21:32:21 | (__begin) | vector.cpp:32:21:32:21 | call to operator* | TAINT |
6644-
| vector.cpp:32:21:32:21 | (__begin) | vector.cpp:32:21:32:21 | call to operator++ | TAINT |
6644+
| vector.cpp:32:21:32:21 | (__begin) | vector.cpp:32:21:32:21 | call to operator++ | |
66456645
| vector.cpp:32:21:32:21 | (__range) | vector.cpp:32:21:32:21 | call to begin | TAINT |
66466646
| vector.cpp:32:21:32:21 | (__range) | vector.cpp:32:21:32:21 | call to end | TAINT |
66476647
| vector.cpp:32:21:32:21 | call to begin | vector.cpp:32:21:32:21 | (__begin) | |
@@ -7652,7 +7652,7 @@
76527652
| vector.cpp:344:56:344:57 | ref arg v2 | vector.cpp:347:7:347:8 | v2 | |
76537653
| vector.cpp:344:56:344:57 | ref arg v2 | vector.cpp:415:1:415:1 | v2 | |
76547654
| vector.cpp:344:56:344:57 | v2 | vector.cpp:344:59:344:61 | call to end | TAINT |
7655-
| vector.cpp:344:68:344:69 | it | vector.cpp:344:66:344:66 | call to operator++ | TAINT |
7655+
| vector.cpp:344:68:344:69 | it | vector.cpp:344:66:344:66 | call to operator++ | |
76567656
| vector.cpp:344:68:344:69 | ref arg it | vector.cpp:344:50:344:51 | it | |
76577657
| vector.cpp:344:68:344:69 | ref arg it | vector.cpp:344:68:344:69 | it | |
76587658
| vector.cpp:344:68:344:69 | ref arg it | vector.cpp:345:4:345:5 | it | |
@@ -7669,7 +7669,7 @@
76697669
| vector.cpp:345:9:345:14 | call to source | vector.cpp:345:3:345:16 | ... = ... | |
76707670
| vector.cpp:347:7:347:8 | ref arg v2 | vector.cpp:415:1:415:1 | v2 | |
76717671
| vector.cpp:349:15:349:15 | (__begin) | vector.cpp:349:15:349:15 | call to operator* | TAINT |
7672-
| vector.cpp:349:15:349:15 | (__begin) | vector.cpp:349:15:349:15 | call to operator++ | TAINT |
7672+
| vector.cpp:349:15:349:15 | (__begin) | vector.cpp:349:15:349:15 | call to operator++ | |
76737673
| vector.cpp:349:15:349:15 | (__end) | vector.cpp:349:15:349:15 | call to iterator | |
76747674
| vector.cpp:349:15:349:15 | (__range) | vector.cpp:349:15:349:15 | call to begin | TAINT |
76757675
| vector.cpp:349:15:349:15 | (__range) | vector.cpp:349:15:349:15 | call to end | TAINT |
@@ -7701,7 +7701,7 @@
77017701
| vector.cpp:354:56:354:57 | ref arg v4 | vector.cpp:357:7:357:8 | v4 | |
77027702
| vector.cpp:354:56:354:57 | ref arg v4 | vector.cpp:415:1:415:1 | v4 | |
77037703
| vector.cpp:354:56:354:57 | v4 | vector.cpp:354:59:354:61 | call to end | TAINT |
7704-
| vector.cpp:354:68:354:69 | it | vector.cpp:354:66:354:66 | call to operator++ | TAINT |
7704+
| vector.cpp:354:68:354:69 | it | vector.cpp:354:66:354:66 | call to operator++ | |
77057705
| vector.cpp:354:68:354:69 | ref arg it | vector.cpp:354:50:354:51 | it | |
77067706
| vector.cpp:354:68:354:69 | ref arg it | vector.cpp:354:68:354:69 | it | |
77077707
| vector.cpp:354:68:354:69 | ref arg it | vector.cpp:355:32:355:33 | it | |
@@ -7961,7 +7961,7 @@
79617961
| vector.cpp:442:3:442:3 | ref arg call to operator* | vector.cpp:444:2:444:2 | out | |
79627962
| vector.cpp:442:4:442:4 | call to operator++ | vector.cpp:442:3:442:3 | call to operator* | TAINT |
79637963
| vector.cpp:442:4:442:4 | ref arg call to operator++ | vector.cpp:442:6:442:7 | ref arg it | |
7964-
| vector.cpp:442:6:442:7 | it | vector.cpp:442:4:442:4 | call to operator++ | TAINT |
7964+
| vector.cpp:442:6:442:7 | it | vector.cpp:442:4:442:4 | call to operator++ | |
79657965
| vector.cpp:442:11:442:36 | call to basic_string | vector.cpp:442:3:442:3 | ref arg call to operator* | TAINT |
79667966
| vector.cpp:442:23:442:35 | source_string | vector.cpp:442:11:442:36 | call to basic_string | TAINT |
79677967
| vector.cpp:443:8:443:10 | ref arg out | vector.cpp:444:2:444:2 | out | |
@@ -7976,7 +7976,7 @@
79767976
| vector.cpp:449:3:449:3 | ref arg call to operator* | vector.cpp:451:2:451:2 | out | |
79777977
| vector.cpp:449:4:449:4 | call to operator++ | vector.cpp:449:3:449:3 | call to operator* | TAINT |
79787978
| vector.cpp:449:4:449:4 | ref arg call to operator++ | vector.cpp:449:6:449:7 | ref arg it | |
7979-
| vector.cpp:449:6:449:7 | it | vector.cpp:449:4:449:4 | call to operator++ | TAINT |
7979+
| vector.cpp:449:6:449:7 | it | vector.cpp:449:4:449:4 | call to operator++ | |
79807980
| vector.cpp:449:11:449:16 | call to source | vector.cpp:449:3:449:3 | ref arg call to operator* | TAINT |
79817981
| vector.cpp:450:8:450:10 | ref arg out | vector.cpp:451:2:451:2 | out | |
79827982
| vector.cpp:467:22:467:25 | call to vector | vector.cpp:471:8:471:8 | v | |

0 commit comments

Comments
 (0)