mirror of
https://github.com/wownero/wownero.git
synced 2026-10-22 01:48:34 +02:00
serialization: handle EOF at varint boundary
This commit is contained in:
@@ -147,7 +147,7 @@ struct binary_archive<false> : public binary_archive_base<false>
|
|||||||
{
|
{
|
||||||
auto current = bytes_.cbegin();
|
auto current = bytes_.cbegin();
|
||||||
auto end = bytes_.cend();
|
auto end = bytes_.cend();
|
||||||
good_ &= (0 <= tools::read_varint(current, end, v));
|
good_ &= (1 <= tools::read_varint(current, end, v));
|
||||||
current = std::min(current, bytes_.cend());
|
current = std::min(current, bytes_.cend());
|
||||||
bytes_ = {current, std::size_t(bytes_.cend() - current)};
|
bytes_ = {current, std::size_t(bytes_.cend() - current)};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user