]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftp: only consider entry path if it has a length
authorDaniel Stenberg <daniel@haxx.se>
Sun, 7 Jan 2024 13:25:20 +0000 (14:25 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 7 Jan 2024 15:34:55 +0000 (16:34 +0100)
Follow-up from 8edcfedc1a144f438bd1cdf814a0016cb

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65631

Avoids a NULL pointer deref.

Closes #12648

lib/ftp.c

index bf8b57db2672a12762d41517a2457c2eec52b44b..cea77d7ee5da8115b25f89400f753974b60b6940 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2892,7 +2892,8 @@ static CURLcode ftp_statemachine(struct Curl_easy *data,
               }
               else {
                 /* end of path */
-                entry_extracted = TRUE;
+                if(Curl_dyn_len(&out))
+                  entry_extracted = TRUE;
                 break; /* get out of this loop */
               }
             }