Skip to content

Commit fa4bc89

Browse files
author
MarcoFalke
committed
fuzz: Fail if message type is not fuzzed
1 parent faefed8 commit fa4bc89

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/fuzz/process_message.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ size_t& GetNumMsgTypes()
5454

5555
void initialize_process_message()
5656
{
57+
Assert(GetNumMsgTypes() == getAllNetMessageTypes().size()); // If this fails, add or remove the message type below
58+
5759
static const auto testing_setup = MakeFuzzingContext<const TestingSetup>();
5860
g_setup = testing_setup.get();
5961
for (int i = 0; i < 2 * COINBASE_MATURITY; i++) {
@@ -104,8 +106,12 @@ void fuzz_target(FuzzBufferType buffer, const std::string& LIMIT_TO_MESSAGE_TYPE
104106

105107
FUZZ_TARGET_INIT(process_message, initialize_process_message) { fuzz_target(buffer, ""); }
106108
FUZZ_TARGET_MSG(addr);
109+
FUZZ_TARGET_MSG(addrv2);
107110
FUZZ_TARGET_MSG(block);
108111
FUZZ_TARGET_MSG(blocktxn);
112+
FUZZ_TARGET_MSG(cfcheckpt);
113+
FUZZ_TARGET_MSG(cfheaders);
114+
FUZZ_TARGET_MSG(cfilter);
109115
FUZZ_TARGET_MSG(cmpctblock);
110116
FUZZ_TARGET_MSG(feefilter);
111117
FUZZ_TARGET_MSG(filteradd);
@@ -114,16 +120,22 @@ FUZZ_TARGET_MSG(filterload);
114120
FUZZ_TARGET_MSG(getaddr);
115121
FUZZ_TARGET_MSG(getblocks);
116122
FUZZ_TARGET_MSG(getblocktxn);
123+
FUZZ_TARGET_MSG(getcfcheckpt);
124+
FUZZ_TARGET_MSG(getcfheaders);
125+
FUZZ_TARGET_MSG(getcfilters);
117126
FUZZ_TARGET_MSG(getdata);
118127
FUZZ_TARGET_MSG(getheaders);
119128
FUZZ_TARGET_MSG(headers);
120129
FUZZ_TARGET_MSG(inv);
121130
FUZZ_TARGET_MSG(mempool);
131+
FUZZ_TARGET_MSG(merkleblock);
122132
FUZZ_TARGET_MSG(notfound);
123133
FUZZ_TARGET_MSG(ping);
124134
FUZZ_TARGET_MSG(pong);
135+
FUZZ_TARGET_MSG(sendaddrv2);
125136
FUZZ_TARGET_MSG(sendcmpct);
126137
FUZZ_TARGET_MSG(sendheaders);
127138
FUZZ_TARGET_MSG(tx);
128139
FUZZ_TARGET_MSG(verack);
129140
FUZZ_TARGET_MSG(version);
141+
FUZZ_TARGET_MSG(wtxidrelay);

0 commit comments

Comments
 (0)