fix decode version 0 rc when in version 1 mode

pull/1379/head
Jeff Becker 4 years ago
parent 79dfb6d357
commit c04cbfe34f
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -266,8 +266,12 @@ namespace llarp
bool
RouterContact::DecodeVersion_0(llarp_buffer_t* buf)
{
signed_bt_dict = std::string(reinterpret_cast<char*>(buf->cur), buf->size_left());
return bencode_decode_dict(*this, buf);
auto begin = reinterpret_cast<char*>(buf->cur);
if (not bencode_decode_dict(*this, buf))
return false;
auto end = reinterpret_cast<char*>(buf->cur);
signed_bt_dict = std::string(begin, std::distance(begin, end));
return true;
}
bool

Loading…
Cancel
Save