mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 03:59:33 +00:00
serialization: fail on read_varint error
This commit is contained in:
parent
68ad548193
commit
db2b9fba65
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)
|
void serialize_uvarint(T &v)
|
||||||
{
|
{
|
||||||
typedef std::istreambuf_iterator<char> it;
|
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)
|
void begin_array(size_t &s)
|
||||||
|
|
Loading…
Reference in a new issue