mirror of
https://github.com/curl/curl.git
synced 2026-07-23 10:07:16 +03:00
urlapi: reject short file URLs
file URLs that are 6 bytes or shorter are not complete. Return CURLUE_MALFORMED_INPUT for those. Extended test 1560 to verify. Triggered by #8041 Closes #8042
This commit is contained in:
parent
ffb6a9e8a6
commit
3e6eb18fce
2 changed files with 10 additions and 0 deletions
|
|
@ -824,6 +824,10 @@ static CURLUcode seturl(const char *url, CURLU *u, unsigned int flags)
|
|||
|
||||
/* handle the file: scheme */
|
||||
if(url_has_scheme && !strcmp(schemebuf, "file")) {
|
||||
if(urllen <= 6)
|
||||
/* file:/ is not enough to actually be a complete file: URL */
|
||||
return CURLUE_MALFORMED_INPUT;
|
||||
|
||||
/* path has been allocated large enough to hold this */
|
||||
strcpy(path, &url[5]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue