1 #include "hb-fuzzer.hh" 2 3 #include <iostream> 4 #include <iterator> 5 #include <fstream> 6 #include <assert.h> 7 FileToString(const std::string & Path)8std::string FileToString(const std::string &Path) { 9 /* TODO This silently passes if file does not exist. Fix it! */ 10 std::ifstream T(Path.c_str()); 11 return std::string((std::istreambuf_iterator<char>(T)), 12 std::istreambuf_iterator<char>()); 13 } 14 main(int argc,char ** argv)15int main(int argc, char **argv) { 16 for (int i = 1; i < argc; i++) { 17 std::string s = FileToString(argv[i]); 18 std::cout << argv[i] << std::endl; 19 LLVMFuzzerTestOneInput((const unsigned char*)s.data(), s.size()); 20 } 21 } 22