mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 16:56:48 +00:00
fix: SponsoringAccountCount has no overflow protection #6898
This commit is contained in:
@@ -437,6 +437,12 @@ Payment::doApply()
|
||||
return tefINTERNAL; // LCOV_EXCL_LINE
|
||||
auto const currentSponsoringAccountCount =
|
||||
sponsor->getFieldU32(sfSponsoringAccountCount);
|
||||
if (currentSponsoringAccountCount == std::numeric_limits<std::uint32_t>::max())
|
||||
{
|
||||
JLOG(j_.fatal()) << "Sponsoring account count overflow for account "
|
||||
<< to_string(account_);
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
sponsor->setFieldU32(sfSponsoringAccountCount, currentSponsoringAccountCount + 1);
|
||||
|
||||
addSponsorToLedgerEntry(sleDst, sponsor);
|
||||
|
||||
Reference in New Issue
Block a user