mirror of
https://github.com/curl/curl.git
synced 2026-07-24 00:57:16 +03:00
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
2 changed files with 6 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue