We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8f9401 commit 53299d6Copy full SHA for 53299d6
cpp/ql/test/query-tests/Likely Bugs/Memory Management/UsingExpiredStackAddress/test.cpp
@@ -181,3 +181,19 @@ void test_escape_through_arrays() {
181
int x18 = s5.pp[0][0]; // BAD
182
int x19 = (*s6.pp)[0]; // BAD
183
}
184
+
185
+void not_escape_through_arrays() {
186
+ int x;
187
188
+ s1.a1[0] = x;
189
+ s1.a2[0][1] = s1.a1[0];
190
+ **s1.a3[0] = 42;
191
+}
192
193
+void test_not_escape_through_array() {
194
+ not_escape_through_arrays();
195
196
+ int x20 = s1.a1[0]; // GOOD
197
+ int x21 = s1.a2[0][1]; // GOOD
198
+ int* x22 = s1.a3[5][2]; // GOOD
199
0 commit comments