Skip to content

Commit

Permalink
fuzz: Check for addrv1 compatibility before using addrv1 serializer o…
Browse files Browse the repository at this point in the history
…n CService
  • Loading branch information
practicalswift committed Nov 2, 2020
1 parent ca18860 commit c2cf8a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/fuzz/deserialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ void test_one_input(const std::vector<uint8_t>& buffer)
#elif SERVICE_DESERIALIZE
CService s;
DeserializeFromFuzzingInput(buffer, s);
AssertEqualAfterSerializeDeserialize(s);
if (s.IsAddrV1Compatible()) {
AssertEqualAfterSerializeDeserialize(s);
}
AssertEqualAfterSerializeDeserialize(s, INIT_PROTO_VERSION | ADDRV2_FORMAT);
#elif MESSAGEHEADER_DESERIALIZE
CMessageHeader mh;
DeserializeFromFuzzingInput(buffer, mh);
Expand Down

0 comments on commit c2cf8a1

Please sign in to comment.