aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-09-27 22:25:01 +0000
committerAnna Zaks <ganna@apple.com>2011-09-27 22:25:01 +0000
commit7e5f112ca7410af93c7cdc07cf3a9dae15214300 (patch)
tree9b31da8a0e76600d351a2deed39c64715bc13a5c /lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
parent5adcec16cb8d9e7bebf310b6c07249dfd852346b (diff)
Fix a crash in MallocOverflowSecurityChecker. Patch by Lei Zhang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
index 983252c771..0f6b621bf7 100644
--- a/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp
@@ -244,6 +244,8 @@ void MallocOverflowSecurityChecker::checkASTCodeBody(const Decl *D,
// Get the name of the callee. If it's a builtin, strip off the prefix.
IdentifierInfo *FnInfo = FD->getIdentifier();
+ if (!FnInfo)
+ return;
if (FnInfo->isStr ("malloc") || FnInfo->isStr ("_MALLOC")) {
if (TheCall->getNumArgs() == 1)