From: Zhongxing Xu Date: Sun, 6 Dec 2009 12:45:46 +0000 (+0000) Subject: Add test case for mktemp. Patch by Lei Zhang. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e605efddac331ef846911b55978ec4ca2f5eba68;p=clang Add test case for mktemp. Patch by Lei Zhang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90706 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/security-syntax-checks.m b/test/Analysis/security-syntax-checks.m index bcdc65ebd4..2ce0684312 100644 --- a/test/Analysis/security-syntax-checks.m +++ b/test/Analysis/security-syntax-checks.m @@ -96,3 +96,9 @@ void test_rand() rand_r(&b); // expected-warning{{Function 'rand_r' is obsolete because it implements a poor random number generator. Use 'arc4random' instead}} random(); // expected-warning{{The 'random' function produces a sequence of values that an adversary may be able to predict. Use 'arc4random' instead}} } + +char *mktemp(char *buf); + +void test_mktemp() { + char *x = mktemp("/tmp/zxcv"); // expected-warning{{Call to function 'mktemp' is insecure as it always creates or uses insecure temporary file}} +}