diff options
Diffstat (limited to 'src/utilstrencodings.cpp')
-rw-r--r-- | src/utilstrencodings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 6837e4e267..b9e64c5fe1 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -16,7 +16,7 @@ using namespace std; // safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything // even possibly remotely dangerous like & or > -static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@"); +static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()"); string SanitizeString(const string& str) { string strResult; @@ -224,7 +224,7 @@ vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid) string DecodeBase64(const string& str) { vector<unsigned char> vchRet = DecodeBase64(str.c_str()); - return string((const char*)&vchRet[0], vchRet.size()); + return (vchRet.size() == 0) ? string() : string((const char*)&vchRet[0], vchRet.size()); } string EncodeBase32(const unsigned char* pch, size_t len) @@ -411,7 +411,7 @@ vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid) string DecodeBase32(const string& str) { vector<unsigned char> vchRet = DecodeBase32(str.c_str()); - return string((const char*)&vchRet[0], vchRet.size()); + return (vchRet.size() == 0) ? string() : string((const char*)&vchRet[0], vchRet.size()); } bool ParseInt32(const std::string& str, int32_t *out) |