mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-05-24 16:55:31 +00:00
decode %00 in url
This commit is contained in:
+4
-2
@@ -549,10 +549,12 @@ namespace http
|
||||
decoded.append (url, start, i - start);
|
||||
if (i + 2 <= url.length ())
|
||||
{
|
||||
char ch;
|
||||
unsigned char ch;
|
||||
auto res = std::from_chars(url.data() + i + 1, url.data() + i + 3, ch, 16);
|
||||
if (res.ec == std::errc())
|
||||
if (res.ec == std::errc() && (ch || allow_null))
|
||||
decoded += ch;
|
||||
else
|
||||
decoded.append (url, i, 3);
|
||||
i += 2;
|
||||
start = i + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user