util: Don't allow ParseMoney(...) of strings with embedded NUL characters

This commit is contained in:
practicalswift committed 2019-12-16 09:04:35 +00:00
1 parent a595011f5a
commit ccc53e43c5
1 file changed
+4
+4
View File
@@ -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);
}