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

Skip to content

Commit cc03716

Browse files
committed
C++: Accept test changes.
1 parent a83879f commit cc03716

6 files changed

Lines changed: 31 additions & 1 deletion

File tree

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-190/AllocMultiplicationOverflow/AllocMultiplicationOverflow.expected

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edges
66
| test.cpp:22:17:22:21 | ... * ... | test.cpp:23:33:23:37 | size1 |
77
| test.cpp:37:24:37:27 | size | test.cpp:37:46:37:49 | size |
88
| test.cpp:45:36:45:40 | ... * ... | test.cpp:37:24:37:27 | size |
9+
| test.cpp:45:36:45:40 | ... * ... | test.cpp:45:36:45:40 | ... * ... |
10+
| test.cpp:45:36:45:40 | ... * ... | test.cpp:45:36:45:40 | ... * ... |
11+
| test.cpp:46:36:46:40 | ... * ... | test.cpp:46:36:46:40 | ... * ... |
912
nodes
1013
| test.cpp:13:33:13:37 | ... * ... | semmle.label | ... * ... |
1114
| test.cpp:13:33:13:37 | ... * ... | semmle.label | ... * ... |
@@ -25,6 +28,10 @@ nodes
2528
| test.cpp:37:46:37:49 | size | semmle.label | size |
2629
| test.cpp:45:36:45:40 | ... * ... | semmle.label | ... * ... |
2730
| test.cpp:45:36:45:40 | ... * ... | semmle.label | ... * ... |
31+
| test.cpp:45:36:45:40 | ... * ... | semmle.label | ... * ... |
32+
| test.cpp:45:36:45:40 | ... * ... | semmle.label | ... * ... |
33+
| test.cpp:46:36:46:40 | ... * ... | semmle.label | ... * ... |
34+
| test.cpp:46:36:46:40 | ... * ... | semmle.label | ... * ... |
2835
| test.cpp:46:36:46:40 | ... * ... | semmle.label | ... * ... |
2936
subpaths
3037
#select
@@ -42,5 +49,10 @@ subpaths
4249
| test.cpp:30:27:30:31 | ... * ... | test.cpp:30:27:30:31 | ... * ... | test.cpp:30:27:30:31 | ... * ... | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:30:27:30:31 | ... * ... | multiplication |
4350
| test.cpp:31:27:31:31 | ... * ... | test.cpp:31:27:31:31 | ... * ... | test.cpp:31:27:31:31 | ... * ... | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:31:27:31:31 | ... * ... | multiplication |
4451
| test.cpp:37:46:37:49 | size | test.cpp:45:36:45:40 | ... * ... | test.cpp:37:46:37:49 | size | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:45:36:45:40 | ... * ... | multiplication |
52+
| test.cpp:37:46:37:49 | size | test.cpp:45:36:45:40 | ... * ... | test.cpp:37:46:37:49 | size | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:45:36:45:40 | ... * ... | multiplication |
4553
| test.cpp:45:36:45:40 | ... * ... | test.cpp:45:36:45:40 | ... * ... | test.cpp:45:36:45:40 | ... * ... | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:45:36:45:40 | ... * ... | multiplication |
54+
| test.cpp:45:36:45:40 | ... * ... | test.cpp:45:36:45:40 | ... * ... | test.cpp:45:36:45:40 | ... * ... | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:45:36:45:40 | ... * ... | multiplication |
55+
| test.cpp:45:36:45:40 | ... * ... | test.cpp:45:36:45:40 | ... * ... | test.cpp:45:36:45:40 | ... * ... | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:45:36:45:40 | ... * ... | multiplication |
56+
| test.cpp:46:36:46:40 | ... * ... | test.cpp:46:36:46:40 | ... * ... | test.cpp:46:36:46:40 | ... * ... | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:46:36:46:40 | ... * ... | multiplication |
57+
| test.cpp:46:36:46:40 | ... * ... | test.cpp:46:36:46:40 | ... * ... | test.cpp:46:36:46:40 | ... * ... | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:46:36:46:40 | ... * ... | multiplication |
4658
| test.cpp:46:36:46:40 | ... * ... | test.cpp:46:36:46:40 | ... * ... | test.cpp:46:36:46:40 | ... * ... | Potentially overflowing value from $@ is used in the size of this allocation. | test.cpp:46:36:46:40 | ... * ... | multiplication |

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ postWithInFlow
9696
| test.cpp:519:3:519:15 | access to array [post update] | PostUpdateNode should not be the target of local flow. |
9797
| test.cpp:520:3:520:12 | stackArray [inner post update] | PostUpdateNode should not be the target of local flow. |
9898
| test.cpp:520:3:520:15 | access to array [post update] | PostUpdateNode should not be the target of local flow. |
99+
| test.cpp:526:3:526:4 | * ... [post update] | PostUpdateNode should not be the target of local flow. |
100+
| test.cpp:526:4:526:4 | e [inner post update] | PostUpdateNode should not be the target of local flow. |
101+
| test.cpp:531:40:531:40 | e [inner post update] | PostUpdateNode should not be the target of local flow. |
99102
viableImplInCallContextTooLarge
100103
uniqueParameterNodeAtPosition
101104
uniqueParameterNodePosition

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,4 +519,15 @@ void uncertain_definition() {
519519
stackArray[0] = source();
520520
stackArray[1] = clean;
521521
sink(stackArray[0]); // $ ast=519:19 ir SPURIOUS: ast=517:7
522+
}
523+
524+
void set_through_const_pointer(int x, const int **e)
525+
{
526+
*e = &x;
527+
}
528+
529+
void test_set_through_const_pointer(int *e)
530+
{
531+
set_through_const_pointer(source(), &e);
532+
sink(*e); // $ ir MISSING: ast
522533
}

cpp/ql/test/library-tests/dataflow/fields/partial-definition-diff.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@
153153
| by_reference.cpp:16:11:16:11 | a | AST only |
154154
| by_reference.cpp:32:15:32:15 | s | IR only |
155155
| by_reference.cpp:36:18:36:18 | this | IR only |
156+
| by_reference.cpp:44:26:44:29 | this | IR only |
157+
| by_reference.cpp:69:22:69:23 | & ... | IR only |
156158
| by_reference.cpp:84:10:84:10 | a | AST only |
157159
| by_reference.cpp:88:9:88:9 | a | AST only |
158160
| by_reference.cpp:92:3:92:5 | * ... | AST only |

cpp/ql/test/library-tests/dataflow/fields/partial-definition-ir.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@
333333
| by_reference.cpp:32:12:32:12 | s |
334334
| by_reference.cpp:36:12:36:15 | this |
335335
| by_reference.cpp:40:12:40:15 | this |
336+
| by_reference.cpp:44:26:44:29 | this |
336337
| by_reference.cpp:50:3:50:3 | s |
337338
| by_reference.cpp:50:17:50:26 | call to user_input |
338339
| by_reference.cpp:51:8:51:8 | s |
@@ -348,6 +349,7 @@
348349
| by_reference.cpp:68:17:68:18 | & ... |
349350
| by_reference.cpp:68:21:68:30 | call to user_input |
350351
| by_reference.cpp:69:8:69:20 | call to nonMemberGetA |
352+
| by_reference.cpp:69:22:69:23 | & ... |
351353
| by_reference.cpp:84:3:84:7 | inner |
352354
| by_reference.cpp:88:3:88:7 | inner |
353355
| by_reference.cpp:102:21:102:39 | & ... |

cpp/ql/test/library-tests/dataflow/source-sink-tests/sources-and-sinks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int readv(int, const struct iovec*, int);
2323
int writev(int, const struct iovec*, int);
2424

2525
void test_readv_and_writev(iovec* iovs) {
26-
readv(0, iovs, 16); // $ MISSING: remote_source
26+
readv(0, iovs, 16); // $ remote_source
2727
writev(0, iovs, 16); // $ remote_sink
2828
}
2929

0 commit comments

Comments
 (0)