aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-07-09 13:12:51 +0800
committerfanquake <fanquake@gmail.com>2021-08-04 19:48:24 +0800
commitf7752adba5dd35fccd3f2144cfcf03538ebf275b (patch)
treedeb01f8d53f0b85bf5cf35b6b045bd869c8eac02 /src/util
parent5ef2738089efd396186775ad23aaec71ea44ebb1 (diff)
util: check MoneyRange() inside ParseMoney()
Diffstat (limited to 'src/util')
-rw-r--r--src/util/moneystr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/moneystr.cpp b/src/util/moneystr.cpp
index d72164f3bf..d3f4029607 100644
--- a/src/util/moneystr.cpp
+++ b/src/util/moneystr.cpp
@@ -81,5 +81,9 @@ std::optional<CAmount> ParseMoney(const std::string& money_string)
CAmount value = nWhole * COIN + nUnits;
+ if (!MoneyRange(value)) {
+ return std::nullopt;
+ }
+
return value;
}