diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2020-11-02 21:45:40 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2020-11-02 21:45:40 +0000 |
commit | c2cf8a18c25bf19ade51fedfa5c352bd7145edb0 (patch) | |
tree | f97aa13010cf65249909b8a8747a9cf41635e54f /src/test | |
parent | ca18860563259d2b42d1a102ab6bc2802ce99b1d (diff) |
fuzz: Check for addrv1 compatibility before using addrv1 serializer on CService
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/fuzz/deserialize.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/fuzz/deserialize.cpp b/src/test/fuzz/deserialize.cpp index 26c56fbadf..9803fdc882 100644 --- a/src/test/fuzz/deserialize.cpp +++ b/src/test/fuzz/deserialize.cpp @@ -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); |