lib1560: verify that more bad host names are rejected

when setting the hostname component of a URL

Closes #10922
This commit is contained in:
Daniel Stenberg 2023-04-11 09:15:41 +02:00
parent 587dac67fb
commit 309a517ffd
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -697,6 +697,24 @@ static int checkurl(const char *org, const char *url, const char *out)
/* !checksrc! disable SPACEBEFORECOMMA 1 */
static const struct setcase set_parts_list[] = {
{"https://example.com/",
"host=http://fake,",
"",
0, /* get */
0, /* set */
CURLUE_OK, CURLUE_BAD_HOSTNAME},
{"https://example.com/",
"host=test%,",
"",
0, /* get */
0, /* set */
CURLUE_OK, CURLUE_BAD_HOSTNAME},
{"https://example.com/",
"host=te st,",
"",
0, /* get */
0, /* set */
CURLUE_OK, CURLUE_BAD_HOSTNAME},
{"https://example.com/",
"host=0xff,", /* '++' there's no automatic URL decode when settin this
part */