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

Skip to content

Commit eb31160

Browse files
committed
C++: Accept test changes.
1 parent 88338bd commit eb31160

5 files changed

Lines changed: 47 additions & 4 deletions

File tree

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-359/semmle/tests/PrivateCleartextWrite.expected

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ edges
22
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode |
33
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode |
44
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode |
5+
| test.cpp:74:24:74:30 | medical | test.cpp:74:11:74:15 | buff1 |
6+
| test.cpp:74:24:74:30 | medical | test.cpp:78:11:78:15 | buff2 |
57
| test.cpp:74:24:74:30 | medical | test.cpp:78:24:78:27 | temp |
68
| test.cpp:74:24:74:30 | medical | test.cpp:81:22:81:28 | medical |
9+
| test.cpp:77:16:77:22 | medical | test.cpp:78:11:78:15 | buff2 |
710
| test.cpp:77:16:77:22 | medical | test.cpp:78:24:78:27 | temp |
811
| test.cpp:77:16:77:22 | medical | test.cpp:81:22:81:28 | medical |
12+
| test.cpp:81:22:81:28 | medical | test.cpp:82:11:82:15 | buff3 |
913
| test.cpp:81:22:81:28 | medical | test.cpp:82:24:82:28 | buff5 |
1014
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode |
1115
| test.cpp:96:37:96:46 | theZipcode | test.cpp:96:37:96:46 | theZipcode |
@@ -26,11 +30,14 @@ nodes
2630
| test.cpp:57:9:57:18 | theZipcode | semmle.label | theZipcode |
2731
| test.cpp:57:9:57:18 | theZipcode | semmle.label | theZipcode |
2832
| test.cpp:57:9:57:18 | theZipcode | semmle.label | theZipcode |
33+
| test.cpp:74:11:74:15 | buff1 | semmle.label | buff1 |
2934
| test.cpp:74:24:74:30 | medical | semmle.label | medical |
3035
| test.cpp:74:24:74:30 | medical | semmle.label | medical |
3136
| test.cpp:77:16:77:22 | medical | semmle.label | medical |
37+
| test.cpp:78:11:78:15 | buff2 | semmle.label | buff2 |
3238
| test.cpp:78:24:78:27 | temp | semmle.label | temp |
3339
| test.cpp:81:22:81:28 | medical | semmle.label | medical |
40+
| test.cpp:82:11:82:15 | buff3 | semmle.label | buff3 |
3441
| test.cpp:82:24:82:28 | buff5 | semmle.label | buff5 |
3542
| test.cpp:96:37:96:46 | theZipcode | semmle.label | theZipcode |
3643
| test.cpp:96:37:96:46 | theZipcode | semmle.label | theZipcode |
@@ -47,9 +54,15 @@ subpaths
4754
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:57:9:57:18 | theZipcode | this source of private data. |
4855
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:57:9:57:18 | theZipcode | this source of private data. |
4956
| test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | test.cpp:57:9:57:18 | theZipcode | This write into the external location 'theZipcode' may contain unencrypted data from $@. | test.cpp:57:9:57:18 | theZipcode | this source of private data. |
57+
| test.cpp:74:11:74:15 | buff1 | test.cpp:74:24:74:30 | medical | test.cpp:74:11:74:15 | buff1 | This write into the external location 'buff1' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
5058
| test.cpp:74:24:74:30 | medical | test.cpp:74:24:74:30 | medical | test.cpp:74:24:74:30 | medical | This write into the external location 'medical' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
59+
| test.cpp:78:11:78:15 | buff2 | test.cpp:74:24:74:30 | medical | test.cpp:78:11:78:15 | buff2 | This write into the external location 'buff2' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
60+
| test.cpp:78:11:78:15 | buff2 | test.cpp:77:16:77:22 | medical | test.cpp:78:11:78:15 | buff2 | This write into the external location 'buff2' may contain unencrypted data from $@. | test.cpp:77:16:77:22 | medical | this source of private data. |
5161
| test.cpp:78:24:78:27 | temp | test.cpp:74:24:74:30 | medical | test.cpp:78:24:78:27 | temp | This write into the external location 'temp' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
5262
| test.cpp:78:24:78:27 | temp | test.cpp:77:16:77:22 | medical | test.cpp:78:24:78:27 | temp | This write into the external location 'temp' may contain unencrypted data from $@. | test.cpp:77:16:77:22 | medical | this source of private data. |
63+
| test.cpp:82:11:82:15 | buff3 | test.cpp:74:24:74:30 | medical | test.cpp:82:11:82:15 | buff3 | This write into the external location 'buff3' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
64+
| test.cpp:82:11:82:15 | buff3 | test.cpp:77:16:77:22 | medical | test.cpp:82:11:82:15 | buff3 | This write into the external location 'buff3' may contain unencrypted data from $@. | test.cpp:77:16:77:22 | medical | this source of private data. |
65+
| test.cpp:82:11:82:15 | buff3 | test.cpp:81:22:81:28 | medical | test.cpp:82:11:82:15 | buff3 | This write into the external location 'buff3' may contain unencrypted data from $@. | test.cpp:81:22:81:28 | medical | this source of private data. |
5366
| test.cpp:82:24:82:28 | buff5 | test.cpp:74:24:74:30 | medical | test.cpp:82:24:82:28 | buff5 | This write into the external location 'buff5' may contain unencrypted data from $@. | test.cpp:74:24:74:30 | medical | this source of private data. |
5467
| test.cpp:82:24:82:28 | buff5 | test.cpp:77:16:77:22 | medical | test.cpp:82:24:82:28 | buff5 | This write into the external location 'buff5' may contain unencrypted data from $@. | test.cpp:77:16:77:22 | medical | this source of private data. |
5568
| test.cpp:82:24:82:28 | buff5 | test.cpp:81:22:81:28 | medical | test.cpp:82:24:82:28 | buff5 | This write into the external location 'buff5' may contain unencrypted data from $@. | test.cpp:81:22:81:28 | medical | this source of private data. |

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void test_vector_output_iterator(int b) {
354354
for(std::vector<int>::iterator it = v4.begin(); it != v4.end(); ++it) {
355355
taint_vector_output_iterator(it);
356356
}
357-
sink(v4); // $ ast MISSING: ir
357+
sink(v4); // $ ast,ir
358358

359359
std::vector<int>::iterator i5 = v5.begin();
360360
*i5 = source();
@@ -389,15 +389,15 @@ void test_vector_output_iterator(int b) {
389389
*i9 = source();
390390
taint_vector_output_iterator(i9);
391391

392-
sink(v9); // $ ast=330:10 ir SPURIOUS: ast=389:8
392+
sink(v9); // $ ast=330:10 ir=330:10 SPURIOUS: ast=389:8 ir=389:8
393393

394394
std::vector<int>::iterator i10 = v10.begin();
395395
vector_iterator_assign_wrapper(i10, 10);
396396
sink(v10);
397397

398398
std::vector<int>::iterator i11 = v11.begin();
399399
vector_iterator_assign_wrapper(i11, source());
400-
sink(v11); // $ ast MISSING: ir
400+
sink(v11); // $ ast,ir
401401

402402
std::vector<int>::iterator i12 = v12.begin();
403403
*i12++ = 0;
@@ -529,6 +529,6 @@ void test_vector_iterator() {
529529
sink(*it);
530530
it += source();
531531
sink(*it); // $ ast,ir
532-
sink(vs[1]);
532+
sink(vs[1]); // $ SPURIOUS: ir
533533
}
534534
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,42 @@
11
edges
22
| tests.cpp:26:15:26:23 | badSource indirection | tests.cpp:51:12:51:20 | call to badSource indirection |
3+
| tests.cpp:26:32:26:35 | data | tests.cpp:26:15:26:23 | badSource indirection |
4+
| tests.cpp:26:32:26:35 | data | tests.cpp:38:25:38:36 | strncat output argument |
5+
| tests.cpp:26:32:26:35 | data indirection | tests.cpp:26:15:26:23 | badSource indirection |
6+
| tests.cpp:26:32:26:35 | data indirection | tests.cpp:38:25:38:36 | strncat output argument |
37
| tests.cpp:33:34:33:39 | call to getenv indirection | tests.cpp:38:39:38:49 | (const char *)... indirection |
48
| tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:26:15:26:23 | badSource indirection |
9+
| tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:26:15:26:23 | badSource indirection |
10+
| tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:26:15:26:23 | badSource indirection |
11+
| tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:51:22:51:25 | badSource output argument |
512
| tests.cpp:38:39:38:49 | (const char *)... indirection | tests.cpp:38:25:38:36 | strncat output argument |
613
| tests.cpp:51:12:51:20 | call to badSource indirection | tests.cpp:53:16:53:19 | (const char *)... indirection |
14+
| tests.cpp:51:22:51:25 | badSource output argument | tests.cpp:51:22:51:25 | data |
15+
| tests.cpp:51:22:51:25 | badSource output argument | tests.cpp:51:22:51:25 | data indirection |
16+
| tests.cpp:51:22:51:25 | data | tests.cpp:26:32:26:35 | data |
17+
| tests.cpp:51:22:51:25 | data | tests.cpp:51:12:51:20 | call to badSource indirection |
18+
| tests.cpp:51:22:51:25 | data | tests.cpp:51:22:51:25 | badSource output argument |
19+
| tests.cpp:51:22:51:25 | data indirection | tests.cpp:26:32:26:35 | data indirection |
20+
| tests.cpp:51:22:51:25 | data indirection | tests.cpp:51:12:51:20 | call to badSource indirection |
721
nodes
822
| tests.cpp:26:15:26:23 | badSource indirection | semmle.label | badSource indirection |
23+
| tests.cpp:26:15:26:23 | badSource indirection | semmle.label | badSource indirection |
24+
| tests.cpp:26:15:26:23 | badSource indirection | semmle.label | badSource indirection |
25+
| tests.cpp:26:32:26:35 | data | semmle.label | data |
26+
| tests.cpp:26:32:26:35 | data indirection | semmle.label | data indirection |
927
| tests.cpp:33:34:33:39 | call to getenv indirection | semmle.label | call to getenv indirection |
1028
| tests.cpp:38:25:38:36 | strncat output argument | semmle.label | strncat output argument |
29+
| tests.cpp:38:25:38:36 | strncat output argument | semmle.label | strncat output argument |
30+
| tests.cpp:38:25:38:36 | strncat output argument | semmle.label | strncat output argument |
1131
| tests.cpp:38:39:38:49 | (const char *)... indirection | semmle.label | (const char *)... indirection |
1232
| tests.cpp:51:12:51:20 | call to badSource indirection | semmle.label | call to badSource indirection |
33+
| tests.cpp:51:22:51:25 | badSource output argument | semmle.label | badSource output argument |
34+
| tests.cpp:51:22:51:25 | data | semmle.label | data |
35+
| tests.cpp:51:22:51:25 | data indirection | semmle.label | data indirection |
1336
| tests.cpp:53:16:53:19 | (const char *)... indirection | semmle.label | (const char *)... indirection |
1437
subpaths
38+
| tests.cpp:51:22:51:25 | data | tests.cpp:26:32:26:35 | data | tests.cpp:26:15:26:23 | badSource indirection | tests.cpp:51:12:51:20 | call to badSource indirection |
39+
| tests.cpp:51:22:51:25 | data | tests.cpp:26:32:26:35 | data | tests.cpp:38:25:38:36 | strncat output argument | tests.cpp:51:22:51:25 | badSource output argument |
40+
| tests.cpp:51:22:51:25 | data indirection | tests.cpp:26:32:26:35 | data indirection | tests.cpp:26:15:26:23 | badSource indirection | tests.cpp:51:12:51:20 | call to badSource indirection |
1541
#select
1642
| tests.cpp:53:16:53:19 | data | tests.cpp:33:34:33:39 | call to getenv indirection | tests.cpp:53:16:53:19 | (const char *)... indirection | This argument to an OS command is derived from $@, dangerously concatenated into $@, and then passed to system(string). | tests.cpp:33:34:33:39 | call to getenv indirection | user input (an environment variable) | tests.cpp:38:25:38:36 | strncat output argument | strncat output argument |

cpp/ql/test/query-tests/Security/CWE/CWE-078/semmle/ExecTainted/ExecTainted.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ edges
4646
| test.cpp:186:47:186:54 | filename indirection | test.cpp:188:20:188:24 | (const char *)... indirection |
4747
| test.cpp:187:11:187:15 | strncat output argument | test.cpp:188:11:188:17 | strncat output argument |
4848
| test.cpp:187:18:187:25 | (const char *)... indirection | test.cpp:187:11:187:15 | strncat output argument |
49+
| test.cpp:188:11:188:17 | strncat output argument | test.cpp:188:11:188:17 | strncat output argument |
50+
| test.cpp:188:11:188:17 | strncat output argument | test.cpp:188:11:188:17 | strncat output argument |
51+
| test.cpp:188:11:188:17 | strncat output argument | test.cpp:188:11:188:17 | strncat output argument |
4952
| test.cpp:188:20:188:24 | (const char *)... indirection | test.cpp:188:11:188:17 | strncat output argument |
5053
| test.cpp:188:20:188:24 | (const char *)... indirection | test.cpp:188:11:188:17 | strncat output argument |
5154
| test.cpp:194:9:194:16 | fread output argument | test.cpp:196:26:196:33 | array to pointer conversion indirection |

cpp/ql/test/query-tests/Security/CWE/CWE-119/semmle/tests/OverflowDestination.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ edges
1717
| overflowdestination.cpp:50:52:50:54 | src | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
1818
| overflowdestination.cpp:50:52:50:54 | src indirection | overflowdestination.cpp:53:15:53:17 | src |
1919
| overflowdestination.cpp:53:9:53:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
20+
| overflowdestination.cpp:54:9:54:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
2021
| overflowdestination.cpp:57:52:57:54 | src | overflowdestination.cpp:64:16:64:19 | src2 |
2122
| overflowdestination.cpp:57:52:57:54 | src indirection | overflowdestination.cpp:64:16:64:19 | src2 |
2223
| overflowdestination.cpp:73:8:73:10 | fgets output argument | overflowdestination.cpp:75:30:75:32 | array to pointer conversion indirection |

0 commit comments

Comments
 (0)