• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s
2 
3 class Evil {
4 public:
5   void system(int); // taint checker
6   void malloc(void *); // taint checker, malloc checker
7   void free(); // malloc checker, keychain checker
8   void fopen(); // stream checker
9   void feof(int, int); // stream checker
10   void open(); // unix api checker
11 };
12 
test(Evil & E)13 void test(Evil &E) {
14   // no warnings, no crashes
15   E.system(0);
16   E.malloc(0);
17   E.free();
18   E.fopen();
19   E.feof(0,1);
20   E.open();
21 }
22