mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-05 08:48:03 +00:00
Reject overlong encodings earlier
This commit is contained in:
@@ -216,6 +216,10 @@ decodeBase58 (std::string const& s,
|
|||||||
++psz;
|
++psz;
|
||||||
--remain;
|
--remain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (remain > 64)
|
||||||
|
return {};
|
||||||
|
|
||||||
// Allocate enough space in big-endian base256 representation.
|
// Allocate enough space in big-endian base256 representation.
|
||||||
// log(58) / log(256), rounded up.
|
// log(58) / log(256), rounded up.
|
||||||
std::vector<unsigned char> b256(
|
std::vector<unsigned char> b256(
|
||||||
|
|||||||
Reference in New Issue
Block a user