ftp: provide error message for control bytes in path

Closes #8460
This commit is contained in:
Daniel Stenberg 2022-02-16 13:53:00 +01:00
parent 8984a42ae4
commit 2ad44ce70d
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -4134,8 +4134,10 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data)
/* url-decode ftp path before further evaluation */
result = Curl_urldecode(ftp->path, 0, &rawPath, &pathLen, REJECT_CTRL);
if(result)
if(result) {
failf(data, "path contains control characters");
return result;
}
switch(data->set.ftp_filemethod) {
case FTPFILE_NOCWD: /* fastest, but less standard-compliant */