forked from lthn/blockchain
sanity check improved
This commit is contained in:
parent
6c318fc34b
commit
0e1618c496
1 changed files with 1 additions and 1 deletions
|
|
@ -44,7 +44,7 @@ bool do_serialize(Archive<false> &ar, std::vector<T> &v)
|
||||||
v.clear();
|
v.clear();
|
||||||
|
|
||||||
// very basic sanity check
|
// very basic sanity check
|
||||||
if (ar.remaining_bytes() < cnt) {
|
if (ar.remaining_bytes() < (cnt * sizeof(T)) ) {
|
||||||
ar.stream().setstate(std::ios::failbit);
|
ar.stream().setstate(std::ios::failbit);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue