diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-06-23 16:13:50 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-06-25 09:57:18 +0200 |
commit | 31e53584db5879894809fbde5445aac7553ac3e2 (patch) | |
tree | 2cdf73cadcb2bbc0e7d9308ef46b9a4a7e44db23 /lib/ftp.c | |
parent | 646cc574f0b72723906224824a57cd37ee88e9df (diff) | |
download | curl-31e53584db5879894809fbde5445aac7553ac3e2.tar.gz |
escape: make the URL decode able to reject only %00 bytes
... or all "control codes" or nothing.
Assisted-by: Nicolas Sterchele
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1452,7 +1452,7 @@ static CURLcode ftp_state_list(struct connectdata *conn) /* url-decode before evaluation: e.g. paths starting/ending with %2f */ const char *slashPos = NULL; char *rawPath = NULL; - result = Curl_urldecode(data, ftp->path, 0, &rawPath, NULL, TRUE); + result = Curl_urldecode(data, ftp->path, 0, &rawPath, NULL, REJECT_CTRL); if(result) return result; @@ -3194,7 +3194,8 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, if(!result) /* get the url-decoded "raw" path */ - result = Curl_urldecode(data, ftp->path, 0, &rawPath, &pathLen, TRUE); + result = Curl_urldecode(data, ftp->path, 0, &rawPath, &pathLen, + REJECT_CTRL); if(result) { /* We can limp along anyway (and should try to since we may already be in * the error path) */ @@ -4110,7 +4111,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn) ftpc->cwdfail = FALSE; /* url-decode ftp path before further evaluation */ - result = Curl_urldecode(data, ftp->path, 0, &rawPath, &pathLen, TRUE); + result = Curl_urldecode(data, ftp->path, 0, &rawPath, &pathLen, REJECT_CTRL); if(result) return result; |