summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-12-06 12:45:46 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-12-06 12:45:46 +0000
commitefd9ae8a8577da3f9063cbe33a2d9430adf11867 (patch)
tree5f4170b2ebec7c68a2c0027b5fa1f294f4cf0db4 /clang
parent6c8884ce08fa40038f67dd0eb99dcd6ccee61d35 (diff)
downloadbcm5719-llvm-efd9ae8a8577da3f9063cbe33a2d9430adf11867.tar.gz
bcm5719-llvm-efd9ae8a8577da3f9063cbe33a2d9430adf11867.zip
Add test case for mktemp. Patch by Lei Zhang.
llvm-svn: 90706
Diffstat (limited to 'clang')
-rw-r--r--clang/test/Analysis/security-syntax-checks.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/security-syntax-checks.m b/clang/test/Analysis/security-syntax-checks.m
index bcdc65ebd45..2ce0684312c 100644
--- a/clang/test/Analysis/security-syntax-checks.m
+++ b/clang/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}}
+}
OpenPOWER on IntegriCloud