mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 12:09:54 +00:00
serialization: fail on read_varint error
This commit is contained in:
parent
19490e44af
commit
d6bb9ecc6f
1 changed files with 2 additions and 1 deletions
|
@ -146,7 +146,8 @@ struct binary_archive<false> : public binary_archive_base<std::istream, false>
|
|||
void serialize_uvarint(T &v)
|
||||
{
|
||||
typedef std::istreambuf_iterator<char> it;
|
||||
tools::read_varint(it(stream_), it(), v); // XXX handle failure
|
||||
if (tools::read_varint(it(stream_), it(), v) < 0)
|
||||
stream_.setstate(std::ios_base::failbit);
|
||||
}
|
||||
|
||||
void begin_array(size_t &s)
|
||||
|
|
Loading…
Reference in a new issue