mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Add MPTAmount overflow check in directSendNoFeeMPT().
This commit is contained in:
@@ -1106,6 +1106,13 @@ directSendNoFeeMPT(
|
||||
if (auto sle = view.peek(mptokenID))
|
||||
{
|
||||
view.creditHookMPT(uSenderID, uReceiverID, saAmount, (*sle)[sfMPTAmount], available);
|
||||
if (view.rules().enabled(featureMPTokensV2))
|
||||
{
|
||||
if ((*sle)[sfMPTAmount] > (std::numeric_limits<std::uint64_t>::max() - amt))
|
||||
{
|
||||
return tecINTERNAL; // LCOV_EXCL_LINE
|
||||
}
|
||||
}
|
||||
(*sle)[sfMPTAmount] += amt;
|
||||
view.update(sle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user