Reject overlong encodings earlier

This commit is contained in:
seelabs
2019-10-28 13:14:26 -07:00
committed by Manoj doshi
parent 906b9ae00b
commit e26dd7bdfe

View File

@@ -216,6 +216,10 @@ decodeBase58 (std::string const& s,
++psz;
--remain;
}
if (remain > 64)
return {};
// Allocate enough space in big-endian base256 representation.
// log(58) / log(256), rounded up.
std::vector<unsigned char> b256(