Skip to content

Commit 1e0a385

Browse files
committed
C++: Put ReturnStackAllocatedMemory.ql on LGTM
1 parent b9236d2 commit 1e0a385

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

change-notes/1.20/analysis-cpp.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
| Use of string copy function in a condition (`cpp/string-copy-return-value-as-boolean`) | correctness | This query identifies calls to string copy functions used in conditions, where it's likely that a different function was intended to be called. |
1212
| Lossy function result cast (`cpp/lossy-function-result-cast`) | correctness | Finds function calls whose result type is a floating point type, which are implicitly cast to an integral type. Newly available but not displayed by default on LGTM. |
1313
| Array argument size mismatch (`cpp/array-arg-size-mismatch`) | reliability | Finds function calls where the size of an array being passed is smaller than the array size of the declared parameter. Newly displayed on LGTM. |
14+
| Returning stack-allocated memory (`cpp/return-stack-allocated-memory`) | reliability, external/cwe/cwe-825 | Finds functions that may return a pointer or reference to stack-allocated memory. This query existed already but has been rewritten from scratch to make the error rate low enough for use on LGTM. Displayed by default. |
1415

1516
## Changes to existing queries
1617

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
* @kind problem
77
* @id cpp/return-stack-allocated-memory
88
* @problem.severity warning
9+
* @precision high
910
* @tags reliability
11+
* external/cwe/cwe-825
1012
*/
1113

1214
import cpp

0 commit comments

Comments
 (0)