Skip to content

Commit 79e2325

Browse files
committed
[analyzer][docs] NFC: Extend documentation for MallocOverflow checker
Patch by Benics Balázs Differential Revision: https://reviews.llvm.org/D70596
1 parent 46883f4 commit 79e2325

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/docs/analyzer/checkers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,6 +1974,12 @@ Check for overflows in the arguments to malloc().
19741974
void *p = malloc(n * sizeof(int)); // warn
19751975
}
19761976
1977+
void test2(int n) {
1978+
if (n > 100) // gives an upper-bound
1979+
return;
1980+
void *p = malloc(n * sizeof(int)); // no warning
1981+
}
1982+
19771983
.. _alpha-security-MmapWriteExec:
19781984
19791985
alpha.security.MmapWriteExec (C)

0 commit comments

Comments
 (0)