From 105848361558d47a10c285c82df5be5ed4f0667f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 7 Jan 2024 14:25:20 +0100 Subject: [PATCH] ftp: only consider entry path if it has a length 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ftp.c b/lib/ftp.c index bf8b57db26..cea77d7ee5 100644 --- 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 */ } }