Skip to content

Commit 399b64b

Browse files
committed
C++: Enable cpp/alloca-in-loop on LGTM
Now that the query has both tests and qhelp, we can use it on LGTM. This commit also adds a change note. I renamed the query to reduce confusion from the lower-case unquoted word "alloca".
1 parent 54091e8 commit 399b64b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

change-notes/1.21/analysis-cpp.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
|-----------------------------|-----------|--------------------------------------------------------------------|
99
| `()`-declared function called with too few arguments (`cpp/too-few-arguments`) | Correctness | Find all cases where the number of arguments is less than the number of parameters of the function, provided the function is also properly declared/defined elsewhere. |
1010
| `()`-declared function called with mismatched arguments (`cpp/mismatched-function-arguments`) | Correctness | Find all cases where the types of arguments do not match the types of parameters of the function, provided the function is also properly declared/defined elsewhere. |
11+
| Call to alloca in a loop (`cpp/alloca-in-loop`) | reliability, correctness, external/cwe/cwe-770 | Finds calls to `alloca` in loops, which can lead to stack overflow if the number of iterations is large. Newly displayed on LGTM. |
1112

1213
## Changes to existing queries
1314

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/**
2-
* @name alloca in a loop
2+
* @name Call to alloca in a loop
33
* @description Using alloca in a loop can lead to a stack overflow
44
* @kind problem
55
* @problem.severity warning
6+
* @precision high
67
* @id cpp/alloca-in-loop
78
* @tags reliability
89
* correctness
10+
* security
911
* external/cwe/cwe-770
1012
*/
1113

0 commit comments

Comments
 (0)