Skip to content

Commit fa3669f

Browse files
author
MarcoFalke
committed
fuzz: Move all addrman fuzz targets to one file
Can be reviewed with --color-moved=dimmed-zebra
1 parent fa7a883 commit fa3669f

File tree

3 files changed

+11
-31
lines changed

3 files changed

+11
-31
lines changed

src/Makefile.test.include

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ test_fuzz_fuzz_SOURCES = \
232232
test/fuzz/crypto_hkdf_hmac_sha256_l32.cpp \
233233
test/fuzz/crypto_poly1305.cpp \
234234
test/fuzz/cuckoocache.cpp \
235-
test/fuzz/data_stream.cpp \
236235
test/fuzz/decode_tx.cpp \
237236
test/fuzz/descriptor_parse.cpp \
238237
test/fuzz/deserialize.cpp \

src/test/fuzz/addrman.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ void initialize_addrman()
2323
SelectParams(CBaseChainParams::REGTEST);
2424
}
2525

26+
FUZZ_TARGET_INIT(data_stream_addr_man, initialize_addrman)
27+
{
28+
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
29+
CDataStream data_stream = ConsumeDataStream(fuzzed_data_provider);
30+
CAddrMan addr_man(/* asmap */ std::vector<bool>(), /* deterministic */ false, /* consistency_check_ratio */ 0);
31+
try {
32+
ReadFromStream(addr_man, data_stream);
33+
} catch (const std::exception&) {
34+
}
35+
}
36+
2637
class CAddrManDeterministic : public CAddrMan
2738
{
2839
public:

src/test/fuzz/data_stream.cpp

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)