diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-12-06 12:45:46 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-12-06 12:45:46 +0000 |
commit | e605efddac331ef846911b55978ec4ca2f5eba68 (patch) | |
tree | e7e070257d103a7fc649a8aa2406e0eabc282146 /test/Analysis/security-syntax-checks.m | |
parent | 30bd7a00901037c6d5471b0999d96287a7a5f70f (diff) | |
download | clang-e605efddac331ef846911b55978ec4ca2f5eba68.tar.gz |
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
Diffstat (limited to 'test/Analysis/security-syntax-checks.m')
-rw-r--r-- | test/Analysis/security-syntax-checks.m | 6 |
1 files changed, 6 insertions, 0 deletions
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}} +} |