fuzz: Check for addrv1 compatibility before using addrv1 serializer on CService
This commit is contained in:
parent
ca18860563
commit
c2cf8a18c2
1 changed files with 4 additions and 1 deletions
|
@ -191,7 +191,10 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
||||||
#elif SERVICE_DESERIALIZE
|
#elif SERVICE_DESERIALIZE
|
||||||
CService s;
|
CService s;
|
||||||
DeserializeFromFuzzingInput(buffer, s);
|
DeserializeFromFuzzingInput(buffer, s);
|
||||||
AssertEqualAfterSerializeDeserialize(s);
|
if (s.IsAddrV1Compatible()) {
|
||||||
|
AssertEqualAfterSerializeDeserialize(s);
|
||||||
|
}
|
||||||
|
AssertEqualAfterSerializeDeserialize(s, INIT_PROTO_VERSION | ADDRV2_FORMAT);
|
||||||
#elif MESSAGEHEADER_DESERIALIZE
|
#elif MESSAGEHEADER_DESERIALIZE
|
||||||
CMessageHeader mh;
|
CMessageHeader mh;
|
||||||
DeserializeFromFuzzingInput(buffer, mh);
|
DeserializeFromFuzzingInput(buffer, mh);
|
||||||
|
|
Loading…
Reference in a new issue