File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,8 @@ test_fuzz_fuzz_SOURCES = \
296
296
test/fuzz/transaction.cpp \
297
297
test/fuzz/tx_in.cpp \
298
298
test/fuzz/tx_out.cpp \
299
- test/fuzz/txrequest.cpp
299
+ test/fuzz/txrequest.cpp \
300
+ test/fuzz/validation_load_mempool.cpp
300
301
endif # ENABLE_FUZZ_BINARY
301
302
302
303
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020 The Bitcoin Core developers
2
+ // Distributed under the MIT software license, see the accompanying
3
+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
+
5
+ #include < chainparamsbase.h>
6
+ #include < test/fuzz/FuzzedDataProvider.h>
7
+ #include < test/fuzz/fuzz.h>
8
+ #include < test/fuzz/util.h>
9
+ #include < test/util/setup_common.h>
10
+ #include < txmempool.h>
11
+ #include < util/time.h>
12
+ #include < validation.h>
13
+
14
+ #include < cstdint>
15
+ #include < vector>
16
+
17
+ void initialize_validation_load_mempool ()
18
+ {
19
+ static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
20
+ }
21
+
22
+ FUZZ_TARGET_INIT (validation_load_mempool, initialize_validation_load_mempool)
23
+ {
24
+ FuzzedDataProvider fuzzed_data_provider{buffer.data (), buffer.size ()};
25
+ SetMockTime (ConsumeTime (fuzzed_data_provider));
26
+ FuzzedFileProvider fuzzed_file_provider = ConsumeFile (fuzzed_data_provider);
27
+
28
+ CTxMemPool pool{};
29
+ auto fuzzed_fopen = [&](const fs::path&, const char *) {
30
+ return fuzzed_file_provider.open ();
31
+ };
32
+ (void )LoadMempool (pool, ::ChainstateActive (), fuzzed_fopen);
33
+ (void )DumpMempool (pool, fuzzed_fopen, true );
34
+ }
You can’t perform that action at this time.
0 commit comments