ftp: only consider entry path if it has a length

Follow-up from 8edcfedc1a

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

Avoids a NULL pointer deref.

Closes #12648
This commit is contained in:
Daniel Stenberg 2024-01-07 14:25:20 +01:00
parent a0f94800d5
commit 1058483615
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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 */
}
}