From 548ddf815c17a9dc49441bdc9b5198fa08ef68d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 11 Apr 2019 09:03:29 +0200 Subject: [PATCH] oss-fuzz: debug code to output testcase in file code.cpp --- oss-fuzz/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oss-fuzz/main.cpp b/oss-fuzz/main.cpp index e25050c84..c564a9787 100644 --- a/oss-fuzz/main.cpp +++ b/oss-fuzz/main.cpp @@ -30,8 +30,13 @@ public: extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) { if (dataSize < 10000) { + const std::string code = generateCode2(data, dataSize); + //std::ofstream fout("code.cpp"); + //fout << code; + //fout.close(); + CppcheckExecutor cppcheckExecutor; - cppcheckExecutor.run(generateCode2(data, dataSize)); + cppcheckExecutor.run(code); } return 0; }