From: Stefan Sperling Subject: Re: gotwebd: urldecode querystring To: Omar Polo Cc: gameoftrees@openbsd.org Date: Sat, 3 Sep 2022 14:26:18 +0200 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.