mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix a corner case when decoding base64:
Under some corner cases, the base64 decoder would not allocate enough memory, which could result in spurious errors. Acknowledgements: Ripple thanks Guido Vranken for originally noticing this issue and responsibly disclosing it to Ripple. Bug Bounties and Responsible Disclosures: We welcome reviews of the rippled code and urge researchers to responsibly disclose any issues that they may find. For more on Ripple's Bug Bounty program, please visit: https://ripple.com/bug-bounty
This commit is contained in:
@@ -96,8 +96,7 @@ inline
|
||||
std::size_t constexpr
|
||||
decoded_size(std::size_t n)
|
||||
{
|
||||
return n / 4 * 3; // requires n&3==0, smaller
|
||||
//return 3 * n / 4;
|
||||
return ((n / 4) * 3) + 2;
|
||||
}
|
||||
|
||||
/** Encode a series of octets as a padded, base64 string.
|
||||
|
||||
Reference in New Issue
Block a user