From 38dd623ef7217298dddfba671d13a34fa84616f8 Mon Sep 17 00:00:00 2001 From: Autofuzz team Date: Wed, 12 Jun 2019 16:02:05 +0200 Subject: [PATCH 01/25] Add a simple fuzz test for jsoncpp. --- AUTHORS | 1 + src/test_lib_json/CMakeLists.txt | 2 ++ src/test_lib_json/fuzz.cpp | 49 ++++++++++++++++++++++++++++++++ src/test_lib_json/fuzz.h | 14 +++++++++ src/test_lib_json/main.cpp | 15 ++++++++++ 5 files changed, 81 insertions(+) create mode 100644 src/test_lib_json/fuzz.cpp create mode 100644 src/test_lib_json/fuzz.h diff --git a/AUTHORS b/AUTHORS index 5747e61c1..93169a829 100644 --- a/AUTHORS +++ b/AUTHORS @@ -37,6 +37,7 @@ datadiode David Seifert David West dawesc +Devin Jeanpierre Dmitry Marakasov dominicpezzuto Don Milham diff --git a/src/test_lib_json/CMakeLists.txt b/src/test_lib_json/CMakeLists.txt index 8a3970fc0..ab0041413 100644 --- a/src/test_lib_json/CMakeLists.txt +++ b/src/test_lib_json/CMakeLists.txt @@ -3,6 +3,8 @@ add_executable( jsoncpp_test jsontest.cpp jsontest.h + fuzz.cpp + fuzz.h main.cpp ) diff --git a/src/test_lib_json/fuzz.cpp b/src/test_lib_json/fuzz.cpp new file mode 100644 index 000000000..8265a17bb --- /dev/null +++ b/src/test_lib_json/fuzz.cpp @@ -0,0 +1,49 @@ +// Copyright 2007-2010 The JsonCpp Authors +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#include "fuzz.h" + +#include +#include +#include +#include +#include +#include + +namespace Json { +class Exception; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + Json::CharReaderBuilder builder; + + if (size < sizeof(uint32_t)) { + return 0; + } + + uint32_t hash_settings = *(const uint32_t*)data; + data += sizeof(uint32_t); + + builder.settings_["failIfExtra"] = hash_settings & (1 << 0); + builder.settings_["allowComments_"] = hash_settings & (1 << 1); + builder.settings_["strictRoot_"] = hash_settings & (1 << 2); + builder.settings_["allowDroppedNullPlaceholders_"] = hash_settings & (1 << 3); + builder.settings_["allowNumericKeys_"] = hash_settings & (1 << 4); + builder.settings_["allowSingleQuotes_"] = hash_settings & (1 << 5); + builder.settings_["failIfExtra_"] = hash_settings & (1 << 6); + builder.settings_["rejectDupKeys_"] = hash_settings & (1 << 7); + builder.settings_["allowSpecialFloats_"] = hash_settings & (1 << 8); + + std::unique_ptr reader(builder.newCharReader()); + + Json::Value root; + const char* data_str = reinterpret_cast(data); + try { + reader->parse(data_str, data_str + size, &root, nullptr); + } catch (Json::Exception const&) { + } + // Whether it succeeded or not doesn't matter. + return 0; +} diff --git a/src/test_lib_json/fuzz.h b/src/test_lib_json/fuzz.h new file mode 100644 index 000000000..f6504377b --- /dev/null +++ b/src/test_lib_json/fuzz.h @@ -0,0 +1,14 @@ +// Copyright 2007-2010 The JsonCpp Authors +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef FUZZ_H_INCLUDED +#define FUZZ_H_INCLUDED + +#include +#include + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); + +#endif // ifndef FUZZ_H_INCLUDED diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 280f7eac6..3dd816e7d 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -10,6 +10,7 @@ #pragma warning(disable : 4996) #endif +#include "fuzz.h" #include "jsontest.h" #include #include @@ -2528,6 +2529,18 @@ JSONTEST_FIXTURE(RValueTest, moveConstruction) { JSONTEST_ASSERT_EQUAL(Json::stringValue, moved["key"].type()); } +struct FuzzTest : JsonTest::TestCase {}; + +// Build and run the fuzz test without any fuzzer, so that it's guaranteed not +// go out of date, even if it's never run as an actual fuzz test. +JSONTEST_FIXTURE(FuzzTest, fuzzDoesntCrash) { + const std::string example = "{}"; + JSONTEST_ASSERT_EQUAL( + 0, + LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), + example.size())); +} + int main(int argc, const char* argv[]) { JsonTest::Runner runner; JSONTEST_REGISTER_FIXTURE(runner, ValueTest, checkNormalizeFloatingPointStr); @@ -2607,6 +2620,8 @@ int main(int argc, const char* argv[]) { JSONTEST_REGISTER_FIXTURE(runner, RValueTest, moveConstruction); + JSONTEST_REGISTER_FIXTURE(runner, FuzzTest, fuzzDoesntCrash); + return runner.runCommandLine(argc, argv); } From 6cbae34f448035f3864344b3e80ff889d2a23c0a Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 09:45:29 -0400 Subject: [PATCH 02/25] Updated header and fixed the bug --- src/test_lib_json/fuzz.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test_lib_json/fuzz.cpp b/src/test_lib_json/fuzz.cpp index 8265a17bb..f79f19ffe 100644 --- a/src/test_lib_json/fuzz.cpp +++ b/src/test_lib_json/fuzz.cpp @@ -1,11 +1,11 @@ -// Copyright 2007-2010 The JsonCpp Authors +// Copyright 2007-2019 The JsonCpp Authors // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #include "fuzz.h" -#include +#include #include #include #include From 3f5b2ec9326a1e020e407d5dc16a4de3f5146974 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 09:49:23 -0400 Subject: [PATCH 03/25] Updated fuzz.h --- src/test_lib_json/fuzz.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test_lib_json/fuzz.h b/src/test_lib_json/fuzz.h index f6504377b..60897a4bc 100644 --- a/src/test_lib_json/fuzz.h +++ b/src/test_lib_json/fuzz.h @@ -6,9 +6,9 @@ #ifndef FUZZ_H_INCLUDED #define FUZZ_H_INCLUDED -#include -#include +#include +#include -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); +int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); #endif // ifndef FUZZ_H_INCLUDED From 0ac1ef1c7c6b883f2c4b4ac14436d7874c987a0e Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 09:50:09 -0400 Subject: [PATCH 04/25] Update fuzz.cpp --- src/test_lib_json/fuzz.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/fuzz.cpp b/src/test_lib_json/fuzz.cpp index f79f19ffe..78d26ad33 100644 --- a/src/test_lib_json/fuzz.cpp +++ b/src/test_lib_json/fuzz.cpp @@ -16,7 +16,7 @@ namespace Json { class Exception; } -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { +int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { Json::CharReaderBuilder builder; if (size < sizeof(uint32_t)) { From 882a0b00e8ae6bb1869cde697ced7b080733c4c3 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 09:50:41 -0400 Subject: [PATCH 05/25] Update fuzz.h --- src/test_lib_json/fuzz.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/fuzz.h b/src/test_lib_json/fuzz.h index 60897a4bc..d5bc08ed1 100644 --- a/src/test_lib_json/fuzz.h +++ b/src/test_lib_json/fuzz.h @@ -7,7 +7,7 @@ #define FUZZ_H_INCLUDED #include -#include +#include int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); From e2976682af618652b7486f09e4b313a7111b69ab Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 10:03:06 -0400 Subject: [PATCH 06/25] Update fuzz.h --- src/test_lib_json/fuzz.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/fuzz.h b/src/test_lib_json/fuzz.h index d5bc08ed1..0816d2757 100644 --- a/src/test_lib_json/fuzz.h +++ b/src/test_lib_json/fuzz.h @@ -9,6 +9,6 @@ #include #include -int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); #endif // ifndef FUZZ_H_INCLUDED From 54f5ef4e3888cc178b7cabf6991255cfac7466f3 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 10:03:26 -0400 Subject: [PATCH 07/25] Update fuzz.cpp --- src/test_lib_json/fuzz.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/fuzz.cpp b/src/test_lib_json/fuzz.cpp index 78d26ad33..f79f19ffe 100644 --- a/src/test_lib_json/fuzz.cpp +++ b/src/test_lib_json/fuzz.cpp @@ -16,7 +16,7 @@ namespace Json { class Exception; } -int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { Json::CharReaderBuilder builder; if (size < sizeof(uint32_t)) { From 95b1aeea86bb7769eca0940d9c6aa9c7d3bd6b94 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 10:25:29 -0400 Subject: [PATCH 08/25] Update fuzz.h --- src/test_lib_json/fuzz.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/fuzz.h b/src/test_lib_json/fuzz.h index 0816d2757..d5bc08ed1 100644 --- a/src/test_lib_json/fuzz.h +++ b/src/test_lib_json/fuzz.h @@ -9,6 +9,6 @@ #include #include -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); +int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); #endif // ifndef FUZZ_H_INCLUDED From b09f8145f237de337c22e4ec7a59c8653c1e1f8d Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 10:26:01 -0400 Subject: [PATCH 09/25] Update fuzz.cpp --- src/test_lib_json/fuzz.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/fuzz.cpp b/src/test_lib_json/fuzz.cpp index f79f19ffe..78d26ad33 100644 --- a/src/test_lib_json/fuzz.cpp +++ b/src/test_lib_json/fuzz.cpp @@ -16,7 +16,7 @@ namespace Json { class Exception; } -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { +int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { Json::CharReaderBuilder builder; if (size < sizeof(uint32_t)) { From c45134db4522e59f4d7318f89e9129ee1974e65c Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 10:32:37 -0400 Subject: [PATCH 10/25] Update fuzz.h --- src/test_lib_json/fuzz.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/fuzz.h b/src/test_lib_json/fuzz.h index d5bc08ed1..0816d2757 100644 --- a/src/test_lib_json/fuzz.h +++ b/src/test_lib_json/fuzz.h @@ -9,6 +9,6 @@ #include #include -int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); #endif // ifndef FUZZ_H_INCLUDED From 2884e69d39df51cd33ac3c248c25924e7c1db07b Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 10:32:52 -0400 Subject: [PATCH 11/25] Update fuzz.cpp --- src/test_lib_json/fuzz.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/fuzz.cpp b/src/test_lib_json/fuzz.cpp index 78d26ad33..f79f19ffe 100644 --- a/src/test_lib_json/fuzz.cpp +++ b/src/test_lib_json/fuzz.cpp @@ -16,7 +16,7 @@ namespace Json { class Exception; } -int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { Json::CharReaderBuilder builder; if (size < sizeof(uint32_t)) { From 5972b886bb58631bbaf03bb0fb9d063026fbc6ac Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 11:20:37 -0400 Subject: [PATCH 12/25] fix llvm --- src/test_lib_json/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 3dd816e7d..ac45b8d91 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -2533,13 +2533,13 @@ struct FuzzTest : JsonTest::TestCase {}; // Build and run the fuzz test without any fuzzer, so that it's guaranteed not // go out of date, even if it's never run as an actual fuzz test. -JSONTEST_FIXTURE(FuzzTest, fuzzDoesntCrash) { - const std::string example = "{}"; - JSONTEST_ASSERT_EQUAL( - 0, - LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), - example.size())); -} +//JSONTEST_FIXTURE(FuzzTest, fuzzDoesntCrash) { +// const std::string example = "{}"; +// JSONTEST_ASSERT_EQUAL( +// 0, +// LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), +// example.size())); +//} int main(int argc, const char* argv[]) { JsonTest::Runner runner; From 43ce3c7526c03a71eab0a8fdbf74bad59ccdd8d6 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 11:34:16 -0400 Subject: [PATCH 13/25] added llvm --- src/test_lib_json/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index ac45b8d91..3dd816e7d 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -2533,13 +2533,13 @@ struct FuzzTest : JsonTest::TestCase {}; // Build and run the fuzz test without any fuzzer, so that it's guaranteed not // go out of date, even if it's never run as an actual fuzz test. -//JSONTEST_FIXTURE(FuzzTest, fuzzDoesntCrash) { -// const std::string example = "{}"; -// JSONTEST_ASSERT_EQUAL( -// 0, -// LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), -// example.size())); -//} +JSONTEST_FIXTURE(FuzzTest, fuzzDoesntCrash) { + const std::string example = "{}"; + JSONTEST_ASSERT_EQUAL( + 0, + LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), + example.size())); +} int main(int argc, const char* argv[]) { JsonTest::Runner runner; From a778bbe6c78e30aea0dbd78a7040f560ad192751 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 11:50:28 -0400 Subject: [PATCH 14/25] Added include fuzz.cpp --- src/test_lib_json/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 3dd816e7d..a706060d8 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -11,6 +11,7 @@ #endif #include "fuzz.h" +#include "fuzz.cpp" #include "jsontest.h" #include #include From 9f0cd22642889c6d495a0599f5cdca5710ce9302 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 12:23:05 -0400 Subject: [PATCH 15/25] Update main.cpp --- src/test_lib_json/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index a706060d8..3dd816e7d 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -11,7 +11,6 @@ #endif #include "fuzz.h" -#include "fuzz.cpp" #include "jsontest.h" #include #include From 73cf116a811a8ef6bf5ac2df7bdb3ae82fda1ad8 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 14:25:00 -0400 Subject: [PATCH 16/25] Update main.cpp --- src/test_lib_json/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 3dd816e7d..983eee929 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -2537,7 +2537,7 @@ JSONTEST_FIXTURE(FuzzTest, fuzzDoesntCrash) { const std::string example = "{}"; JSONTEST_ASSERT_EQUAL( 0, - LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), + fuzz::LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), example.size())); } From ebc2047ce763f6d9843872fa95934b4c89b3dd5b Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 14:27:36 -0400 Subject: [PATCH 17/25] Update main.cpp --- src/test_lib_json/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 983eee929..3dd816e7d 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -2537,7 +2537,7 @@ JSONTEST_FIXTURE(FuzzTest, fuzzDoesntCrash) { const std::string example = "{}"; JSONTEST_ASSERT_EQUAL( 0, - fuzz::LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), + LLVMFuzzerTestOneInput(reinterpret_cast(example.c_str()), example.size())); } From a845c63978361105d7c7104a2a837fee0c993349 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 14:50:25 -0400 Subject: [PATCH 18/25] Update CMakeLists.txt --- src/test_lib_json/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/CMakeLists.txt b/src/test_lib_json/CMakeLists.txt index ab0041413..f9490b8ad 100644 --- a/src/test_lib_json/CMakeLists.txt +++ b/src/test_lib_json/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable( jsoncpp_test if(BUILD_SHARED_LIBS) add_definitions( -DJSON_DLL ) endif() -target_link_libraries(jsoncpp_test jsoncpp_lib) +target_link_libraries(jsoncpp_test jsoncpp_lib fuzz) # another way to solve issue #90 #set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store) From 7101a858ff3b85a61a5a636519b4190b283a2055 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 15:00:57 -0400 Subject: [PATCH 19/25] Update CMakeLists.txt --- src/test_lib_json/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/CMakeLists.txt b/src/test_lib_json/CMakeLists.txt index f9490b8ad..ab0041413 100644 --- a/src/test_lib_json/CMakeLists.txt +++ b/src/test_lib_json/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable( jsoncpp_test if(BUILD_SHARED_LIBS) add_definitions( -DJSON_DLL ) endif() -target_link_libraries(jsoncpp_test jsoncpp_lib fuzz) +target_link_libraries(jsoncpp_test jsoncpp_lib) # another way to solve issue #90 #set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store) From d715e7341e7114c33cbb36e62d279ed775105d89 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 15:06:19 -0400 Subject: [PATCH 20/25] Update jsontest.cpp --- src/test_lib_json/jsontest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test_lib_json/jsontest.cpp b/src/test_lib_json/jsontest.cpp index c0b5296d9..2bf4108d5 100644 --- a/src/test_lib_json/jsontest.cpp +++ b/src/test_lib_json/jsontest.cpp @@ -5,6 +5,7 @@ #define _CRT_SECURE_NO_WARNINGS 1 // Prevents deprecation warning with MSVC #include "jsontest.h" +#inlcude "fuzz.h" #include #include From aca048c53a19199cba6bb10c8aedb0857ea27a82 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 15:07:31 -0400 Subject: [PATCH 21/25] Update jsontest.cpp --- src/test_lib_json/jsontest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_lib_json/jsontest.cpp b/src/test_lib_json/jsontest.cpp index 2bf4108d5..b23909404 100644 --- a/src/test_lib_json/jsontest.cpp +++ b/src/test_lib_json/jsontest.cpp @@ -5,7 +5,7 @@ #define _CRT_SECURE_NO_WARNINGS 1 // Prevents deprecation warning with MSVC #include "jsontest.h" -#inlcude "fuzz.h" +#include "fuzz.h" #include #include From a32b5304c154d6bde9b845ae6e13f8ea305410d1 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Mon, 24 Jun 2019 15:13:53 -0400 Subject: [PATCH 22/25] Update jsontest.cpp --- src/test_lib_json/jsontest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test_lib_json/jsontest.cpp b/src/test_lib_json/jsontest.cpp index b23909404..c0b5296d9 100644 --- a/src/test_lib_json/jsontest.cpp +++ b/src/test_lib_json/jsontest.cpp @@ -5,7 +5,6 @@ #define _CRT_SECURE_NO_WARNINGS 1 // Prevents deprecation warning with MSVC #include "jsontest.h" -#include "fuzz.h" #include #include From 7b3f0279af5262c7fe7fd451ccdbbf614d4c075e Mon Sep 17 00:00:00 2001 From: Google-Autofuzz Date: Wed, 26 Jun 2019 17:19:42 -0400 Subject: [PATCH 23/25] added fuzz.cpp to macro in main.cpp --- src/test_lib_json/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 3dd816e7d..a706060d8 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -11,6 +11,7 @@ #endif #include "fuzz.h" +#include "fuzz.cpp" #include "jsontest.h" #include #include From e16638a85a79b7e2b2072ae1710f87f0889190ea Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Wed, 26 Jun 2019 17:32:33 -0400 Subject: [PATCH 24/25] Update main.cpp --- src/test_lib_json/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index a706060d8..3dd816e7d 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -11,7 +11,6 @@ #endif #include "fuzz.h" -#include "fuzz.cpp" #include "jsontest.h" #include #include From 0a35653139fc4cb7a556803781bfbd43758802b9 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Wed, 26 Jun 2019 17:40:59 -0400 Subject: [PATCH 25/25] Add fuzz.cpp to jsoncpp_test --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 106e17f6a..8c6c32555 100644 --- a/meson.build +++ b/meson.build @@ -88,7 +88,8 @@ jsoncpp_test = executable( 'jsoncpp_test', [ 'src/test_lib_json/jsontest.cpp', 'src/test_lib_json/jsontest.h', - 'src/test_lib_json/main.cpp'], + 'src/test_lib_json/main.cpp', + 'src/test_lib_json/fuzz.cpp'], include_directories : jsoncpp_include_directories, link_with : jsoncpp_lib, install : false,