aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-03-03 13:09:30 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-03-03 13:09:30 +0000
commit7d68101f83a28323fa24b1f705881415ccbe6467 (patch)
tree0eba93f5995b9221367e1f39327790bc3eda3e70 /lib/ftp.c
parentaa50a00898495b2f3a4334ecbe4d81efa6dd6b6b (diff)
Prevent uploading to a URL that has no file name part.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 02732f452..da2aeb9e2 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3816,6 +3816,13 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
ftp->file=NULL; /* instead of point to a zero byte, we make it a NULL
pointer */
+ if(data->set.upload && !ftp->file &&
+ (!ftp->no_transfer || conn->bits.no_body)) {
+ /* We need a file name when uploading. Return error! */
+ failf(data, "Uploading to a URL without a file name!");
+ return CURLE_URL_MALFORMAT;
+ }
+
ftp->cwddone = FALSE; /* default to not done */
if(ftp->prevpath) {