Skip to content

Commit a145e52

Browse files
committed
C++: Add uninitialized local test
1 parent b4d6cb6 commit a145e52

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

cpp/ql/test/query-tests/Security/CWE/CWE-457/semmle/tests/UninitializedLocal.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
edges
22
nodes
33
| errors.cpp:13:7:13:7 | definition of x | semmle.label | definition of x |
4+
| ms_vacopy.c:4:13:4:15 | definition of va2 | semmle.label | definition of va2 |
45
| test.cpp:11:6:11:8 | definition of foo | semmle.label | definition of foo |
56
| test.cpp:111:6:111:8 | definition of foo | semmle.label | definition of foo |
67
| test.cpp:226:7:226:7 | definition of x | semmle.label | definition of x |
@@ -16,6 +17,7 @@ nodes
1617
| test.cpp:479:6:479:6 | definition of x | semmle.label | definition of x |
1718
#select
1819
| errors.cpp:14:18:14:18 | x | errors.cpp:13:7:13:7 | definition of x | errors.cpp:13:7:13:7 | definition of x | The variable $@ may not be initialized at this access. | errors.cpp:13:7:13:7 | x | x |
20+
| ms_vacopy.c:5:13:5:15 | va2 | ms_vacopy.c:4:13:4:15 | definition of va2 | ms_vacopy.c:4:13:4:15 | definition of va2 | The variable $@ may not be initialized at this access. | ms_vacopy.c:4:13:4:15 | va2 | va2 |
1921
| test.cpp:12:6:12:8 | foo | test.cpp:11:6:11:8 | definition of foo | test.cpp:11:6:11:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:11:6:11:8 | foo | foo |
2022
| test.cpp:113:6:113:8 | foo | test.cpp:111:6:111:8 | definition of foo | test.cpp:111:6:111:8 | definition of foo | The variable $@ may not be initialized at this access. | test.cpp:111:6:111:8 | foo | foo |
2123
| test.cpp:227:3:227:3 | x | test.cpp:226:7:226:7 | definition of x | test.cpp:226:7:226:7 | definition of x | The variable $@ may not be initialized at this access. | test.cpp:226:7:226:7 | x | x |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <stdarg.h>
2+
3+
int va_copy_test(va_list va) {
4+
va_list va2;
5+
va_copy(va2, va);
6+
return 0;
7+
}
8+
// semmle-extractor-options: --microsoft

0 commit comments

Comments
 (0)