You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 25d3af9
Browse filesBrowse the repository at this point in the historyBrowse files
* The "Returning stack-allocated memory" (`cpp/return-stack-allocated-memory`) query now also detects returning stack-allocated memory allocated by calls to `alloca`, `strdupa`, and `strndupa`.
Copy file name to clipboardExpand all lines: cpp/ql/test/query-tests/Likely Bugs/Memory Management/ReturnStackAllocatedMemory/ReturnStackAllocatedMemory.expected
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,11 @@ edges
43
43
| test.cpp:189:16:189:16 | p | test.cpp:189:16:189:16 | (reference to) |
| test.cpp:190:10:190:13 | CopyValue: (reference to) | test.cpp:189:16:189:16 | p | test.cpp:190:10:190:13 | (reference to) | May return stack-allocated memory from $@. | test.cpp:189:16:189:16 | p | p |
131
+
| test.cpp:238:9:238:9 | Load: p | test.cpp:237:12:237:17 | call to alloca | test.cpp:238:9:238:9 | p | May return stack-allocated memory from $@. | test.cpp:237:12:237:17 | call to alloca | call to alloca |
132
+
| test.cpp:245:9:245:15 | Call: call to strdupa | test.cpp:245:9:245:15 | call to strdupa | test.cpp:245:9:245:15 | call to strdupa | May return stack-allocated memory from $@. | test.cpp:245:9:245:15 | call to strdupa | call to strdupa |
133
+
| test.cpp:250:9:250:10 | Convert: (void *)... | test.cpp:249:13:249:20 | call to strndupa | test.cpp:250:9:250:10 | (void *)... | May return stack-allocated memory from $@. | test.cpp:249:13:249:20 | call to strndupa | call to strndupa |
| test.cpp:37:73:37:76 | data | test.cpp:43:32:43:35 | data |
3
-
| test.cpp:37:73:37:76 | data | test.cpp:43:32:43:35 | data |
4
-
| test.cpp:37:73:37:76 | data indirection | test.cpp:43:32:43:35 | data |
5
-
| test.cpp:37:73:37:76 | data indirection | test.cpp:43:32:43:35 | data |
6
-
| test.cpp:64:30:64:35 | call to getenv | test.cpp:73:24:73:27 | data |
7
-
| test.cpp:64:30:64:35 | call to getenv | test.cpp:73:24:73:27 | data |
8
-
| test.cpp:64:30:64:35 | call to getenv | test.cpp:73:24:73:27 | data indirection |
9
-
| test.cpp:64:30:64:35 | call to getenv | test.cpp:73:24:73:27 | data indirection |
10
-
| test.cpp:73:24:73:27 | data | test.cpp:37:73:37:76 | data |
2
+
| test.cpp:37:73:37:76 | data indirection | test.cpp:43:32:43:35 | data indirection |
3
+
| test.cpp:64:30:64:35 | call to getenv indirection | test.cpp:73:24:73:27 | data indirection |
11
4
| test.cpp:73:24:73:27 | data indirection | test.cpp:37:73:37:76 | data indirection |
12
-
subpaths
13
5
nodes
14
-
| test.cpp:37:73:37:76 | data | semmle.label | data |
15
6
| test.cpp:37:73:37:76 | data indirection | semmle.label | data indirection |
16
-
| test.cpp:43:32:43:35 | data | semmle.label | data |
17
-
| test.cpp:43:32:43:35 | data | semmle.label | data |
18
-
| test.cpp:64:30:64:35 | call to getenv | semmle.label | call to getenv |
19
-
| test.cpp:64:30:64:35 | call to getenv | semmle.label | call to getenv |
20
-
| test.cpp:73:24:73:27 | data | semmle.label | data |
7
+
| test.cpp:43:32:43:35 | data indirection | semmle.label | data indirection |
8
+
| test.cpp:64:30:64:35 | call to getenv indirection | semmle.label | call to getenv indirection |
21
9
| test.cpp:73:24:73:27 | data indirection | semmle.label | data indirection |
10
+
subpaths
22
11
#select
23
-
| test.cpp:43:32:43:35 | data | test.cpp:64:30:64:35 | call to getenv | test.cpp:43:32:43:35 | data | The value of this argument may come from $@ and is being passed to LoadLibraryA. | test.cpp:64:30:64:35 | call to getenv | call to getenv |
12
+
| test.cpp:43:32:43:35 | data indirection | test.cpp:64:30:64:35 | call to getenv indirection | test.cpp:43:32:43:35 | data indirection | The value of this argument may come from $@ and is being passed to LoadLibraryA. | test.cpp:64:30:64:35 | call to getenv indirection | an environment variable |
0 commit comments