Address OOB read in the base58 decoder:

Under some circumstances, it is possible to induce an out-of-bounds
memory read in the base58 decoder.

This commit addresses this issue.

Acknowledgements:
    Guido Vranken for discovering and responsibly disclosing this issue.

Bug Bounties and Responsible Disclosures:
    We welcome reviews of the rippled code and urge researchers to
    responsibly disclose any issues they may find.

    Ripple is generously sponsoring a bug bounty program for the
    rippled project. For more information please visit:

        https://ripple.com/bug-bounty
This commit is contained in:
Edward Hennis
2021-07-21 18:10:45 -04:00
committed by Nik Bougalis
parent 1061b01ab3
commit 53df35eef3

View File

@@ -149,7 +149,7 @@ encodeBase58(
static std::string
decodeBase58(std::string const& s)
{
auto psz = s.c_str();
auto psz = reinterpret_cast<unsigned char const*>(s.c_str());
auto remain = s.size();
// Skip and count leading zeroes
int zeroes = 0;