mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 05:13:25 +01:00
serialization: fail on read_varint error
This commit is contained in:
parent
68ad548193
commit
db2b9fba65
@ -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 New Issue
Block a user