Re: [PATCH] Do not decode url protocol.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> writes:

> Otherwise, the patch sounds good.

Humm, looking a bit closer ...

Pascal Obry <pascal@xxxxxxxx> writes:

> @@ -70,9 +70,18 @@ static int url_decode_char(const char *q)
>  static char *url_decode_internal(const char **query, const char *stop_at)
>  {

This function is called from multiple places :


char *url_decode(const char *url)
{
	return url_decode_internal(&url, NULL);
}

char *url_decode_parameter_name(const char **query)
{
	return url_decode_internal(query, "&=");
}

char *url_decode_parameter_value(const char **query)
{
	return url_decode_internal(query, "&");
}

I don't think you want to avoid escaping until the first slash in
url_decode_parameter_name and url_decode_parameter_value. I think you
want to patch url_decode, not url_decode_internal.

> +	/* Skip protocol. */
> +	first_slash = strchr(*query, '/');

Are you sure the URL contains a / at this point? That would be a user
error if it doesn't, but has this been validated (with a clean error
message if needed) earlier in the code?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]