aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-04-30 20:04:17 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-04-30 20:04:17 +0000
commit3ef06d7efe38b895354b20db5af1aae38392383b (patch)
tree0a0e0c338b8a7cd77daba02a1f05e3e31913bb55
parentfb012b48e9db45ceb032379248a1a4d4c155d620 (diff)
when making up the list of path parts, save the last entry pointing to NULL
as otherwise we'll go nuts
-rw-r--r--lib/ftp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index aa96871cb..43ea99801 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2126,8 +2126,9 @@ CURLcode Curl_ftp(struct connectdata *conn)
}
else {
cur_pos = slash_pos + 1; /* jump to the rest of the string */
- if(++path_part >= CURL_MAX_FTP_DIRDEPTH) {
- /* too deep */
+ if(++path_part >= (CURL_MAX_FTP_DIRDEPTH-1)) {
+ /* too deep, we need the last entry to be kept NULL at all
+ times to signal end of list */
failf(data, "too deep dir hierarchy");
retcode = CURLE_URL_MALFORMAT;
}