summaryrefslogtreecommitdiff
path: root/clang/docs/analyzer/checkers.rst
diff options
context:
space:
mode:
Diffstat (limited to 'clang/docs/analyzer/checkers.rst')
-rw-r--r--clang/docs/analyzer/checkers.rst33
1 files changed, 21 insertions, 12 deletions
diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst
index b2effadacf9f..15d7557ae6af 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -1859,6 +1859,27 @@ this) and always check the return value of these calls.
This check corresponds to SEI CERT Rule `POS36-C <https://wiki.sei.cmu.edu/confluence/display/c/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges>`_.
+.. _security-VAList:
+
+security.VAList (C, C++)
+""""""""""""""""""""""""
+Reports use of uninitialized (or already released) ``va_list`` objects and
+situations where a ``va_start`` call is not followed by ``va_end``.
+
+.. code-block:: c
+
+ int test_use_after_release(int x, ...) {
+ va_list va;
+ va_start(va, x);
+ va_end(va);
+ return va_arg(va, int); // warn: va is uninitialized
+ }
+
+ void test_leak(int x, ...) {
+ va_list va;
+ va_start(va, x);
+ } // warn: va is leaked
+
.. _unix-checkers:
unix
@@ -2932,18 +2953,6 @@ the locking/unlocking of ``mtx_t`` mutexes.
mtx_lock(&mtx1); // warn: This lock has already been acquired
}
-.. _alpha-core-CastSize:
-
-alpha.core.CastSize (C)
-"""""""""""""""""""""""
-Check when casting a malloc'ed type ``T``, whether the size is a multiple of the size of ``T``.
-
-.. code-block:: c
-
- void test() {
- int *x = (int *) malloc(11); // warn
- }
-
.. _alpha-core-CastToStruct:
alpha.core.CastToStruct (C, C++)