aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2024-04-21 21:48:05 +0200
committerFabian Jahr <fjahr@protonmail.com>2024-04-24 23:27:50 +0200
commit992c714451676cee33d3dff49f36329423270c1c (patch)
tree546f604e7e1e8c540ec54b38886114e986958168 /src/common
parent099fa571511f113e0056d4bc27b3153a42f9dc65 (diff)
downloadbitcoin-992c714451676cee33d3dff49f36329423270c1c.tar.xz
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.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/url.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/common/url.cpp b/src/common/url.cpp
index f27bb2b73f..ecf88d07ea 100644
--- a/src/common/url.cpp
+++ b/src/common/url.cpp
@@ -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;