mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +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)
|
||||
{
|
||||
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