]> granicus.if.org Git - clang/commitdiff
Improve static analyzer diagnostic concerning the use of 'mktemp'
authorTed Kremenek <kremenek@apple.com>
Wed, 24 Mar 2010 22:39:45 +0000 (22:39 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 24 Mar 2010 22:39:45 +0000 (22:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99441 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/CheckSecuritySyntaxOnly.cpp

index 923baf50f3f6062b712f7b332cf5d0533a4ea59d..98a739b07dd6ad0a5f53e03ebc8fb8d232d3cc68 100644 (file)
@@ -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>