File tree Expand file tree Collapse file tree 4 files changed +4
-8
lines changed
cpp/ql/test/query-tests/Security/CWE Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 7
7
| test.cpp:170:6:170:9 | data | Memory pointed to by 'data' may have been previously freed $@ | test.cpp:165:2:165:5 | call to free | here |
8
8
| test.cpp:193:6:193:9 | data | Memory pointed to by 'data' may have been previously freed $@ | test.cpp:191:3:191:6 | call to free | here |
9
9
| test.cpp:201:6:201:6 | x | Memory pointed to by 'x' may have been previously freed $@ | test.cpp:200:2:200:9 | delete | here |
10
- | test.cpp:222:9:222:12 | data | Memory pointed to by 'data' may have been previously freed $@ | test.cpp:223:5:223:8 | call to free | here |
11
- | test.cpp:223:10:223:13 | data | Memory pointed to by 'data' may have been previously freed $@ | test.cpp:223:5:223:8 | call to free | here |
12
- | test.cpp:234:9:234:12 | data | Memory pointed to by 'data' may have been previously freed $@ | test.cpp:230:5:230:8 | call to free | here |
Original file line number Diff line number Diff line change @@ -219,8 +219,8 @@ void test16(int n, bool b) {
219
219
for (int i = 0 ; i < n; ++i) {
220
220
if (b) data = (char *)malloc (10 * sizeof (char ));
221
221
if (!b || data == NULL ) return ;
222
- use (data); // GOOD [FALSE POSITIVE]
223
- free (data); // GOOD [FALSE POSITIVE]
222
+ use (data); // GOOD
223
+ free (data); // GOOD
224
224
}
225
225
}
226
226
@@ -231,6 +231,6 @@ void test17(int n, bool b) {
231
231
}
232
232
233
233
if (!b) {
234
- use (data); // GOOD [FALSE POSITIVE]
234
+ use (data); // GOOD
235
235
}
236
236
}
Original file line number Diff line number Diff line change 8
8
| test.cpp:132:9:132:9 | j | The variable $@ may not be initialized here. | test.cpp:126:6:126:6 | j | j |
9
9
| test.cpp:219:3:219:3 | x | The variable $@ may not be initialized here. | test.cpp:218:7:218:7 | x | x |
10
10
| test.cpp:243:13:243:13 | i | The variable $@ may not be initialized here. | test.cpp:241:6:241:6 | i | i |
11
- | test.cpp:329:9:329:11 | val | The variable $@ may not be initialized here. | test.cpp:321:6:321:8 | val | val |
12
11
| test.cpp:336:10:336:10 | a | The variable $@ may not be initialized here. | test.cpp:333:7:333:7 | a | a |
13
12
| test.cpp:369:10:369:10 | a | The variable $@ may not be initialized here. | test.cpp:358:7:358:7 | a | a |
14
13
| test.cpp:378:9:378:11 | val | The variable $@ may not be initialized here. | test.cpp:359:6:359:8 | val | val |
Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ int test28() {
326
326
a = false ;
327
327
c = false ;
328
328
}
329
- return val; // GOOD [FALSE POSITIVE]
329
+ return val; // GOOD
330
330
}
331
331
332
332
int test29 () {
You can’t perform that action at this time.
0 commit comments