diff --git a/src/libxrpl/protocol/IOUAmount.cpp b/src/libxrpl/protocol/IOUAmount.cpp index 987bb37ac9..1b3e5b3737 100644 --- a/src/libxrpl/protocol/IOUAmount.cpp +++ b/src/libxrpl/protocol/IOUAmount.cpp @@ -52,6 +52,18 @@ IOUAmount::normalize() } std::tie(mantissa_, exponent_) = Number::normalizeToRange(mantissa_, exponent_); + + // normalizeToRange only enforces Number's much wider exponent bounds. + // Re-apply IOUAmount's narrower range here, matching the check + // IOUAmount(Number const&) applies on its own construction path. + if (exponent_ > kMaxExponent) + { + Throw("value overflow"); + } + if (exponent_ < kMinExponent) + { + *this = beast::kZero; + } } IOUAmount::IOUAmount(Number const& other) : IOUAmount(fromNumber(other))