escape: make the URL decode able to reject only %00 bytes

... or all "control codes" or nothing.

Assisted-by: Nicolas Sterchele
This commit is contained in:
Daniel Stenberg 2020-06-23 16:13:50 +02:00
parent 646cc574f0
commit 31e53584db
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
16 changed files with 60 additions and 34 deletions

View file

@ -1185,7 +1185,10 @@ CURLUcode curl_url_get(CURLU *u, CURLUPart what,
if(urldecode) {
char *decoded;
size_t dlen;
CURLcode res = Curl_urldecode(NULL, *part, 0, &decoded, &dlen, TRUE);
/* this unconditional rejection of control bytes is documented
API behavior */
CURLcode res = Curl_urldecode(NULL, *part, 0, &decoded, &dlen,
REJECT_CTRL);
free(*part);
if(res) {
*part = NULL;