mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Don't unescape %00.
This commit is contained in:
parent
1230b724ca
commit
486d672e99
@ -1,3 +1,8 @@
|
||||
2005-05-05 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* url.c (url_unescape): Don't unescape %00, it effectively
|
||||
truncates the string.
|
||||
|
||||
2005-05-05 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* log.c (copy_and_escape): Replace the FOR_URI argument with a
|
||||
|
@ -175,10 +175,16 @@ url_unescape (char *s)
|
||||
}
|
||||
else
|
||||
{
|
||||
char c;
|
||||
/* Do nothing if '%' is not followed by two hex digits. */
|
||||
if (!h[1] || !h[2] || !(ISXDIGIT (h[1]) && ISXDIGIT (h[2])))
|
||||
goto copychar;
|
||||
*t = X2DIGITS_TO_NUM (h[1], h[2]);
|
||||
c = X2DIGITS_TO_NUM (h[1], h[2]);
|
||||
/* Don't unescape %00 because there is no way to insert it
|
||||
into a C string without effectively truncating it. */
|
||||
if (c == '\0')
|
||||
goto copychar;
|
||||
*t = c;
|
||||
h += 2;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user