Minor code hardening: Verify the final bytes of the string
are actually accessible before trying to use them.
This commit is contained in:
parent
aabccf4a0d
commit
40715dc446
@ -2362,7 +2362,7 @@ url_decode(const char *in)
|
||||
if (out == NULL)
|
||||
return (NULL);
|
||||
for (s = in, d = out; *s != '\0'; ) {
|
||||
if (*s == '%') {
|
||||
if (s[0] == '%' && s[1] != '\0' && s[2] != '\0') {
|
||||
/* Try to convert % escape */
|
||||
int digit1 = tohex(s[1]);
|
||||
int digit2 = tohex(s[2]);
|
||||
|
Loading…
Reference in New Issue
Block a user