mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
urlapi: require a non-zero host name length when parsing URL
Updated test 1560 to verify. Closes #3880
This commit is contained in:
parent
c60042fe09
commit
9f9ec7da57
@ -636,6 +636,8 @@ static CURLUcode hostname_check(struct Curl_URL *u, char *hostname)
|
|||||||
/* hostname with bad content */
|
/* hostname with bad content */
|
||||||
return CURLUE_MALFORMED_INPUT;
|
return CURLUE_MALFORMED_INPUT;
|
||||||
}
|
}
|
||||||
|
if(!hostname[0])
|
||||||
|
return CURLUE_NO_HOST;
|
||||||
return CURLUE_OK;
|
return CURLUE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,6 +140,9 @@ static struct testcase get_parts_list[] ={
|
|||||||
"file | [11] | [12] | [13] | [14] | [15] | C:\\programs\\foo | [16] | [17]",
|
"file | [11] | [12] | [13] | [14] | [15] | C:\\programs\\foo | [16] | [17]",
|
||||||
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
|
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
|
||||||
#endif
|
#endif
|
||||||
|
/* URL without host name */
|
||||||
|
{"http://a:b@/x", "",
|
||||||
|
CURLU_DEFAULT_SCHEME, 0, CURLUE_NO_HOST},
|
||||||
{"boing:80",
|
{"boing:80",
|
||||||
"https | [11] | [12] | [13] | boing | 80 | / | [16] | [17]",
|
"https | [11] | [12] | [13] | boing | 80 | / | [16] | [17]",
|
||||||
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
|
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
|
||||||
|
Loading…
Reference in New Issue
Block a user