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

Skip to content

Commit b9236d2

Browse files
committed
C++: Improve ReturnStackAllocatedMemory alert msg
1 parent dcf910f commit b9236d2

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ where
4646
)
4747
)
4848
)
49-
select r, "May return stack-allocated memory."
49+
select r, "May return stack-allocated memory from $@.", va, va.toString()
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
| test.cpp:17:2:17:12 | return ... | May return stack-allocated memory. |
2-
| test.cpp:25:2:25:12 | return ... | May return stack-allocated memory. |
3-
| test.cpp:47:2:47:11 | return ... | May return stack-allocated memory. |
4-
| test.cpp:54:2:54:16 | return ... | May return stack-allocated memory. |
5-
| test.cpp:92:2:92:12 | return ... | May return stack-allocated memory. |
6-
| test.cpp:112:2:112:12 | return ... | May return stack-allocated memory. |
7-
| test.cpp:119:2:119:19 | return ... | May return stack-allocated memory. |
1+
| test.cpp:17:2:17:12 | return ... | May return stack-allocated memory from $@. | test.cpp:17:10:17:11 | mc | mc |
2+
| test.cpp:25:2:25:12 | return ... | May return stack-allocated memory from $@. | test.cpp:23:18:23:19 | mc | mc |
3+
| test.cpp:47:2:47:11 | return ... | May return stack-allocated memory from $@. | test.cpp:47:9:47:10 | mc | mc |
4+
| test.cpp:54:2:54:16 | return ... | May return stack-allocated memory from $@. | test.cpp:54:11:54:12 | mc | mc |
5+
| test.cpp:92:2:92:12 | return ... | May return stack-allocated memory from $@. | test.cpp:89:10:89:11 | mc | mc |
6+
| test.cpp:112:2:112:12 | return ... | May return stack-allocated memory from $@. | test.cpp:112:9:112:11 | arr | arr |
7+
| test.cpp:119:2:119:19 | return ... | May return stack-allocated memory from $@. | test.cpp:119:11:119:13 | arr | arr |

0 commit comments

Comments
 (0)