"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: gotwebd: urldecode querystring
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Sat, 3 Sep 2022 14:26:18 +0200

Download raw body.

Thread
On Sat, Sep 03, 2022 at 12:27:17PM +0200, Omar Polo wrote:
> thanks for the pointer!  I was a bit too lazy here.  I like httpd'
> url_decode, here's a new version of the diff using it.
> 
> There's one thing that I don't get in the httpd' url_decode function though:
> 
>   569	/* Encoding character is followed by two hex chars */
>   570	if (!(isxdigit((unsigned char)p[1]) &&
>   571	    isxdigit((unsigned char)p[2])))
>   572		return (NULL);
>   573
> 
> shouldn't be like in diff below?

Well, the xdigit checking logic is equivalent (De Morgan's law) between
the two versions. Plus your check also rejects "0x00". 

ok for the diff.