MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / FUZZ_TARGET

Function FUZZ_TARGET

src/test/fuzz/protocol.cpp:15–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include <vector>
14
15FUZZ_TARGET(protocol)
16{
17 FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
18 const std::optional<CInv> inv = ConsumeDeserializable<CInv>(fuzzed_data_provider);
19 if (!inv) {
20 return;
21 }
22 try {
23 (void)inv->GetMessageType();
24 } catch (const std::out_of_range&) {
25 }
26 (void)inv->ToString();
27 const std::optional<CInv> another_inv = ConsumeDeserializable<CInv>(fuzzed_data_provider);
28 if (!another_inv) {
29 return;
30 }
31 (void)(*inv < *another_inv);
32}

Callers

nothing calls this directly

Calls 4

dataMethod · 0.45
sizeMethod · 0.45
GetMessageTypeMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected