diff --git a/src/test/fuzz/addrman.cpp b/src/test/fuzz/addrman.cpp index b12f421bc8..14bc170d55 100644 --- a/src/test/fuzz/addrman.cpp +++ b/src/test/fuzz/addrman.cpp @@ -34,6 +34,17 @@ FUZZ_TARGET_INIT(addrman, initialize_addrman) addr_man.m_asmap.clear(); } } + if (fuzzed_data_provider.ConsumeBool()) { + const std::vector serialized_data{ConsumeRandomLengthByteVector(fuzzed_data_provider)}; + CDataStream ds(serialized_data, SER_DISK, INIT_PROTO_VERSION); + const auto ser_version{fuzzed_data_provider.ConsumeIntegral()}; + ds.SetVersion(ser_version); + try { + ds >> addr_man; + } catch (const std::ios_base::failure&) { + addr_man.Clear(); + } + } while (fuzzed_data_provider.ConsumeBool()) { CallOneOf( fuzzed_data_provider,