From 575383b3e1361e60ba88738a34d92b1662f915a7 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 2 Oct 2019 08:01:27 +0000 Subject: [PATCH 1/2] tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus --- test/fuzz/test_runner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py index ffebb579e7f..080f565f9b8 100755 --- a/test/fuzz/test_runner.py +++ b/test/fuzz/test_runner.py @@ -20,6 +20,7 @@ FUZZERS_MISSING_CORPORA = [ "block_header_and_short_txids_deserialize", "fee_rate_deserialize", "flat_file_pos_deserialize", + "integer", "key_origin_info_deserialize", "merkle_block_deserialize", "out_point_deserialize", From 597d10ceb9fd2a118c7e551cd6263379691d9295 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 9 Oct 2019 15:51:32 +0000 Subject: [PATCH 2/2] tests: Add fuzzing harness for various functions consuming only integrals --- src/Makefile.test.include | 7 +++ src/test/fuzz/integer.cpp | 127 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 src/test/fuzz/integer.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 6ae15cc553c..70b72b5c0e0 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -26,6 +26,7 @@ FUZZ_TARGETS = \ test/fuzz/eval_script \ test/fuzz/fee_rate_deserialize \ test/fuzz/flat_file_pos_deserialize \ + test/fuzz/integer \ test/fuzz/inv_deserialize \ test/fuzz/key_origin_info_deserialize \ test/fuzz/merkle_block_deserialize \ @@ -365,6 +366,12 @@ test_fuzz_eval_script_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) test_fuzz_eval_script_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) test_fuzz_eval_script_LDADD = $(FUZZ_SUITE_LD_COMMON) +test_fuzz_integer_SOURCES = $(FUZZ_SUITE) test/fuzz/integer.cpp +test_fuzz_integer_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) +test_fuzz_integer_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) +test_fuzz_integer_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) +test_fuzz_integer_LDADD = $(FUZZ_SUITE_LD_COMMON) + test_fuzz_txoutcompressor_deserialize_SOURCES = $(FUZZ_SUITE) test/fuzz/deserialize.cpp test_fuzz_txoutcompressor_deserialize_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -DTXOUTCOMPRESSOR_DESERIALIZE=1 test_fuzz_txoutcompressor_deserialize_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) diff --git a/src/test/fuzz/integer.cpp b/src/test/fuzz/integer.cpp new file mode 100644 index 00000000000..723938bcdb7 --- /dev/null +++ b/src/test/fuzz/integer.cpp @@ -0,0 +1,127 @@ +// Copyright (c) 2019 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include