urlapi: setting a blank URL ("") is not an ok URL
Test it in 1560 Fixes #11714 Reported-by: ad0p on github Closes #11715
This commit is contained in:
parent
5e2beb3395
commit
887b998e6e
@ -1816,6 +1816,10 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
|
||||
char *oldurl;
|
||||
char *redired_url;
|
||||
|
||||
if(!nalloc)
|
||||
/* a blank URL is not a valid URL */
|
||||
return CURLUE_MALFORMED_INPUT;
|
||||
|
||||
/* if the new thing is absolute or the old one is not
|
||||
* (we could not get an absolute url in 'oldurl'),
|
||||
* then replace the existing with the new. */
|
||||
|
||||
@ -151,6 +151,8 @@ struct clearurlcase {
|
||||
};
|
||||
|
||||
static const struct testcase get_parts_list[] ={
|
||||
{"", "", 0, 0, CURLUE_MALFORMED_INPUT},
|
||||
{" ", "", 0, 0, CURLUE_MALFORMED_INPUT},
|
||||
{"1h://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
|
||||
{"..://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
|
||||
{"-ht://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user