aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-06-29 21:01:35 +0000
committerTed Kremenek <kremenek@apple.com>2012-06-29 21:01:35 +0000
commitb0754170b249e896298df24fa28fbd9a008a114d (patch)
treeac02a8ae140ee3e99ab93b6e30228040bc58d7a3 /lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
parent4f50875f3bb5174fe669a7a08790d76e67f4a7cd (diff)
Revert "Tweak insecureAPI analyzer checks to have the ability to be individually disabled."
Jordan Rose corrected me that this actually isn't needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
index 053b83f894..dde90713ce 100644
--- a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
+++ b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
@@ -379,6 +379,13 @@ void WalkAST::checkCall_getpw(const CallExpr *CE, const FunctionDecl *FD) {
//===----------------------------------------------------------------------===//
void WalkAST::checkCall_mktemp(const CallExpr *CE, const FunctionDecl *FD) {
+ if (!filter.check_mktemp) {
+ // Fall back to the security check of looking for enough 'X's in the
+ // format string, since that is a less severe warning.
+ checkCall_mkstemp(CE, FD);
+ return;
+ }
+
const FunctionProtoType *FPT
= dyn_cast<FunctionProtoType>(FD->getType().IgnoreParens());
if(!FPT)
@@ -762,9 +769,8 @@ public:
}
#define REGISTER_CHECKER(name) \
-namespace { class Checker_##name : public SecuritySyntaxChecker {}; }\
void ento::register##name(CheckerManager &mgr) {\
- mgr.registerChecker<Checker_##name>()->filter.check_##name = true;\
+ mgr.registerChecker<SecuritySyntaxChecker>()->filter.check_##name = true;\
}
REGISTER_CHECKER(gets)