[cfe-commits] r90706 - /cfe/trunk/test/Analysis/security-syntax-checks.m
Zhongxing Xu
xuzhongxing at gmail.com
Sun Dec 6 04:45:47 PST 2009
Author: zhongxingxu
Date: Sun Dec 6 06:45:46 2009
New Revision: 90706
URL: http://llvm.org/viewvc/llvm-project?rev=90706&view=rev
Log:
Add test case for mktemp. Patch by Lei Zhang.
Modified:
cfe/trunk/test/Analysis/security-syntax-checks.m
Modified: cfe/trunk/test/Analysis/security-syntax-checks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/security-syntax-checks.m?rev=90706&r1=90705&r2=90706&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/security-syntax-checks.m (original)
+++ cfe/trunk/test/Analysis/security-syntax-checks.m Sun Dec 6 06:45:46 2009
@@ -96,3 +96,9 @@
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}}
+}
More information about the cfe-commits
mailing list