From: Daniel Stenberg Date: Sat, 6 Jun 2026 21:38:22 +0000 (+0200) Subject: ftplistparser: clear strings.target if not symlink X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fcurl.git ftplistparser: clear strings.target if not symlink When the struct is passed to the CURLOPT_CHUNK_BGN_FUNCTION callback, clear the pointer if the provided data is not a symlink. Closes #21884 --- diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c index 0c8cea4dc9..a4fffc86dc 100644 --- a/lib/ftplistparser.c +++ b/lib/ftplistparser.c @@ -310,8 +310,9 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data, str + parser->offsets.group : NULL; finfo->strings.perm = parser->offsets.perm ? str + parser->offsets.perm : NULL; - finfo->strings.target = parser->offsets.symlink_target ? - str + parser->offsets.symlink_target : NULL; + finfo->strings.target = parser->offsets.symlink_target && + (finfo->filetype == CURLFILETYPE_SYMLINK) ? + str + parser->offsets.symlink_target : NULL; finfo->strings.time = str + parser->offsets.time; finfo->strings.user = parser->offsets.user ? str + parser->offsets.user : NULL;