diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/strencodings.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp index dfd8961cb7..31719cd975 100644 --- a/src/util/strencodings.cpp +++ b/src/util/strencodings.cpp @@ -266,6 +266,12 @@ std::vector<unsigned char> DecodeBase32(const char* p, bool* pf_invalid) std::string DecodeBase32(const std::string& str, bool* pf_invalid) { + if (!ValidAsCString(str)) { + if (pf_invalid) { + *pf_invalid = true; + } + return {}; + } std::vector<unsigned char> vchRet = DecodeBase32(str.c_str(), pf_invalid); return std::string((const char*)vchRet.data(), vchRet.size()); } |