[cfe-commits] r146794 - /cfe/trunk/test/Analysis/taint-tester.c
Anna Zaks
ganna at apple.com
Fri Dec 16 16:30:16 PST 2011
Author: zaks
Date: Fri Dec 16 18:30:16 2011
New Revision: 146794
URL: http://llvm.org/viewvc/llvm-project?rev=146794&view=rev
Log:
[analyzer] Fixup for r146793. Add tests for atol and atoll.
Modified:
cfe/trunk/test/Analysis/taint-tester.c
Modified: cfe/trunk/test/Analysis/taint-tester.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/taint-tester.c?rev=146794&r1=146793&r2=146794&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/taint-tester.c (original)
+++ cfe/trunk/test/Analysis/taint-tester.c Fri Dec 16 18:30:16 2011
@@ -155,7 +155,6 @@
// return value, ptr arguments.
int atoi(const char *nptr);
-// TODO: Add support for atol and atoll.
long atol(const char *nptr);
long long atoll(const char *nptr);
@@ -164,5 +163,17 @@
scanf("%s", s);
int d = atoi(s); // expected-warning + {{tainted}}
int td = d; // expected-warning + {{tainted}}
+
+ // TODO: We shouldn't have to redefine the taint source here.
+ char sl[80];
+ scanf("%s", sl);
+ long l = atol(sl); // expected-warning + {{tainted}}
+ int tl = l; // expected-warning + {{tainted}}
+
+ char sll[80];
+ scanf("%s", sll);
+ long long ll = atoll(sll); // expected-warning + {{tainted}}
+ int tll = ll; // expected-warning + {{tainted}}
+
}
More information about the cfe-commits
mailing list