[cfe-commits] r146541 - /cfe/trunk/test/Analysis/taint-tester.c

Anna Zaks ganna at apple.com
Tue Dec 13 18:00:54 PST 2011


Author: zaks
Date: Tue Dec 13 20:00:54 2011
New Revision: 146541

URL: http://llvm.org/viewvc/llvm-project?rev=146541&view=rev
Log:
[analyzer] Revert the taint test, which is failing on one of the bots for time being.

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=146541&r1=146540&r2=146541&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/taint-tester.c (original)
+++ cfe/trunk/test/Analysis/taint-tester.c Tue Dec 13 20:00:54 2011
@@ -76,49 +76,3 @@
     m = inn;
   int mm = m; // expected-warning   {{tainted}}
 }
-
-// Test getenv.
-char *getenv(const char *name);
-void getenvTest(char *home) {
-  home = getenv("HOME"); // expected-warning 2 {{tainted}}
-  if (home != 0) { // expected-warning 2 {{tainted}}
-      char d = home[0]; // expected-warning 2 {{tainted}}
-    }
-}
-
-typedef struct _FILE FILE;
-extern FILE *stdin;
-extern FILE *stdout;
-extern FILE *stderr;
-int fscanf(FILE *restrict stream, const char *restrict format, ...);
-int fprintf(FILE *stream, const char *format, ...);
-int fclose(FILE *stream);
-FILE *fopen(const char *path, const char *mode);
-
-int fscanfTest(void) {
-  FILE *fp;
-  char s[80];
-  int t;
-
-  // Check if stdin is treated as tainted.
-  fscanf(stdin, "%s %d", s, &t);
-  // Note, here, s is not tainted, but the data s points to is tainted.
-  char *ts = s;
-  char tss = s[0]; // expected-warning 1 {{tainted}}
-  int tt = t; // expected-warning 1 {{tainted}}
-  if((fp=fopen("test", "w")) == 0) // expected-warning 3 {{tainted}}
-    return 1;
-  fprintf(fp, "%s %d", s, t); // expected-warning 2 {{tainted}}
-  fclose(fp); // expected-warning 1 {{tainted}}
-
-  // Check if we propagate taint from stdin when it's used in an assignment.
-  FILE *pfstd = stdin;
-  fscanf(pfstd, "%s %d", s, &t); // TODO: This should be tainted as well.
-
-  // Test fscanf and fopen.
-  if((fp=fopen("test","r")) == 0) // expected-warning 3 {{tainted}}
-    return 1;
-  fscanf(fp, "%s%d", s, &t); // expected-warning 1 {{tainted}}
-  fprintf(stdout, "%s %d", s, t); // expected-warning 1 {{tainted}}
-  return 0;
-}





More information about the cfe-commits mailing list