summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/docs/analyzer/checkers.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/docs/analyzer/checkers.rst b/clang/docs/analyzer/checkers.rst
index a751b148097..b410c085878 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -1974,6 +1974,12 @@ Check for overflows in the arguments to malloc().
void *p = malloc(n * sizeof(int)); // warn
}
+ void test2(int n) {
+ if (n > 100) // gives an upper-bound
+ return;
+ void *p = malloc(n * sizeof(int)); // no warning
+ }
+
.. _alpha-security-MmapWriteExec:
alpha.security.MmapWriteExec (C)
OpenPOWER on IntegriCloud