aboutsummaryrefslogtreecommitdiff
path: root/src/util/moneystr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/moneystr.cpp')
-rw-r--r--src/util/moneystr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/moneystr.cpp b/src/util/moneystr.cpp
index ba5a12e58c..2797f450ca 100644
--- a/src/util/moneystr.cpp
+++ b/src/util/moneystr.cpp
@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
-// Copyright (c) 2009-2018 The Bitcoin Core developers
+// Copyright (c) 2009-2019 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -7,6 +7,7 @@
#include <tinyformat.h>
#include <util/strencodings.h>
+#include <util/string.h>
std::string FormatMoney(const CAmount& n)
{
@@ -32,6 +33,9 @@ std::string FormatMoney(const CAmount& n)
bool ParseMoney(const std::string& str, CAmount& nRet)
{
+ if (!ValidAsCString(str)) {
+ return false;
+ }
return ParseMoney(str.c_str(), nRet);
}