git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Do not decode url protocol.

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 22, 2010, 11:34 UTC
Message-ID
<vpqiq5bb8rx.fsf@bauges.imag.fr>
In-Reply-To
<AANLkTinK99krA-16qUO8nWYbZ7w6o632jLTTW5WyaKOk@mail.gmail.com>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> Otherwise, the patch sounds good.
Humm, looking a bit closer ...
Pascal Obry <pascal@obry.net> 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/
Previous: Matthieu MoyNext: Pascal Obry
Message 3 of 6 in “Do not decode url protocol.”
  1. Do not decode url protocol.Pascal Obry, Jun 22, 2010
  2. Matthieu MoyJun 22, 2010
  3. Matthieu MoyJun 22, 2010
  4. Pascal ObryJun 22, 2010
  5. René ScharfeJun 23, 2010
  6. Junio C HamanoJun 29, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.