]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftp: provide error message for control bytes in path
authorDaniel Stenberg <daniel@haxx.se>
Wed, 16 Feb 2022 12:53:00 +0000 (13:53 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 17 Feb 2022 07:24:14 +0000 (08:24 +0100)
Closes #8460

lib/ftp.c

index 908c970e3c6ae5da55d9157e3cb95386e0d63dba..c6efaedd3db382f3e8264b2db1237e92636cc09f 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -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 */