int begin_fuzz (const char *path, int fuzztype, int argc, char **argv) { DIR *dirp; struct dirent *dp; char *buff = NULL; struct stat statbuf; int ix = 0; if ((dirp = opendir (path)) == NULL) { fprintf (stderr, "Error opening specified directory [%s]\n", path); perror ("opendir"); exit (-1); } while ((dp = readdir (dirp))) { buff = realloc (buff, p_strlen (path) + 1 + strlen (dp->d_name) + 1); sprintf (buff, "%s/%s", path, dp->d_name); if (stat (buff, &statbuf)) { perror ("stat"); exit (-1); } if (!(strcmp (dp->d_name, "ifuzz")) || !(strcmp (dp->d_name, ".")) || !(strcmp (dp->d_name, "..")) || !(statbuf.st_mode & S_IEXEC) || !(S_ISREG (statbuf.st_mode))) continue; printf ("Executable: %s\n", dp->d_name); ix++; do_fuzz (buff, dp->d_name, fuzztype, argc, argv); } free (buff); closedir (dirp); printf ("Fuzzed %d files in directory %s\n", ix, path); return 0; }
virtual void onDrawContent(SkCanvas* canvas) { do_fuzz(canvas); this->inval(NULL); }
virtual void onDrawContent(SkCanvas* canvas) { do_fuzz(canvas); }