diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-03-24 22:39:45 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-03-24 22:39:45 +0000 |
commit | 431a2cb703af68b4c2cc2b6df08999fce7b0b689 (patch) | |
tree | 0eec130edb0db2d43764cdc2a2c7dd4bb0516e2d /lib/Checker/CheckSecuritySyntaxOnly.cpp | |
parent | 49b95450202e58b78599c512f8621bdd39abda78 (diff) |
Improve static analyzer diagnostic concerning the use of 'mktemp'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/CheckSecuritySyntaxOnly.cpp')
-rw-r--r-- | lib/Checker/CheckSecuritySyntaxOnly.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Checker/CheckSecuritySyntaxOnly.cpp b/lib/Checker/CheckSecuritySyntaxOnly.cpp index 923baf50f3..98a739b07d 100644 --- a/lib/Checker/CheckSecuritySyntaxOnly.cpp +++ b/lib/Checker/CheckSecuritySyntaxOnly.cpp @@ -328,17 +328,16 @@ void WalkAST::CheckCall_mktemp(const CallExpr *CE, const FunctionDecl *FD) { // Verify that the argument is a 'char*'. if (PT->getPointeeType().getUnqualifiedType() != BR.getContext().CharTy) return; - + // Issue a waring. SourceRange R = CE->getCallee()->getSourceRange(); BR.EmitBasicReport("Potential insecure temporary file in call 'mktemp'", "Security", "Call to function 'mktemp' is insecure as it always " - "creates or uses insecure temporary file", + "creates or uses insecure temporary file. Use 'mkstemp' instead", CE->getLocStart(), &R, 1); } - //===----------------------------------------------------------------------===// // Check: Linear congruent random number generators should not be used // Originally: <rdar://problem/63371000> |