]> granicus.if.org Git - curl/commitdiff
when making up the list of path parts, save the last entry pointing to NULL
authorDaniel Stenberg <daniel@haxx.se>
Wed, 30 Apr 2003 20:04:17 +0000 (20:04 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 30 Apr 2003 20:04:17 +0000 (20:04 +0000)
as otherwise we'll go nuts

lib/ftp.c

index aa96871cbf2944a2a9fff926b3e6c46199c5ba07..43ea998015d9bc55e1c7176e050b6f8686849854 100644 (file)
--- 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;
       }