1
0
Fork 0
forked from lthn/blockchain

reverted sanity check improvement

This commit is contained in:
sowle 2025-07-20 02:34:45 +03:00
parent 23cf10a4b8
commit 854c198415
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -44,7 +44,7 @@ bool do_serialize(Archive<false> &ar, std::vector<T> &v)
v.clear();
// very basic sanity check
if (ar.remaining_bytes() < (cnt * sizeof(T)) ) {
if (ar.remaining_bytes() < cnt) {
ar.stream().setstate(std::ios::failbit);
return false;
}