Add MPTAmount overflow check in directSendNoFeeMPT().

This commit is contained in:
Gregory Tsipenyuk
2026-04-23 13:13:17 -04:00
parent 00f39cdd9c
commit ddc419daaf

View File

@@ -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);
}