When fuzzing the base58 functions I noticed that `DecodeBase58(const std::string& str, …)` is perhaps a bit too liberal in what input it accepts when decoding.

I naïvely assumed that `DecodeBase58(const std::string& str, …)` would return `false` when passing it a `str` which contains at least one character that is not any of the base58 characters (all alphanumeric characters except for "0", "I", "O", and "l") or the whitespace characters.

That is not the case:
* `str` contains `good` → `DecodeBase58(const std::string& str, …) == true` (as expected)
* `str` contains `bad0IOl` → `DecodeBase58(const std::string& str, …) == false` (as expected)
* `str` contains `good\x00bad0IOl` → `DecodeBase58(const std::string& str, …) == true`(!)

The reason is that `DecodeBase58(const std::string& str, …)` calls `DecodeBase58(const char* psz, …)` which will only consider the string up to the first `\x00`.
{
    
    std::vector<unsigned char> vch(vchIn);
    uint256 hash = Hash(vch.begin(), vch.end());
    vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
    return EncodeBase58(vch);
}
bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet, int max_ret_len)
{
    if (!DecodeBase58(psz, vchRet, max_ret_len > std::numeric_limits<int>::max() - 4 ? std::numeric_limits<int>::max() : max_ret_len + 4) ||
        (vchRet.size() < 4)) {
        vchRet.clear();
        return false;
    }
    
    uint256 hash = Hash(vchRet.begin(), vchRet.end() - 4);
    if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {
        vchRet.clear();
        return false;
    }
    vchRet.resize(vchRet.size() - 4);
    return true;
}
bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet, int max_ret)
{
    return DecodeBase58Check(str.c_str(), vchRet, max_ret);
}