mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-21 13:10:08 +01:00
common: Don't terminate on null character in UrlDecode
The previous behavior was the result of casting the result returned from the libevent function evhttp_uridecode to std:string but this was probably not intended.
This commit is contained in:
@@ -25,11 +25,6 @@ std::string UrlDecode(std::string_view url_encoded)
|
||||
// Only if there is no error and the pointer is set to the end of
|
||||
// the string, we can be sure both characters were valid hex
|
||||
if (ec == std::errc{} && p == url_encoded.data() + i + 3) {
|
||||
// A null character terminates the string
|
||||
if (decoded_value == 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
res += static_cast<char>(decoded_value);
|
||||
// Next two characters are part of the percent encoding
|
||||
i += 2;
|
||||
|
||||
Reference in New Issue
Block a user