Skip to content

ftplistparser: clear strings.target if not symlink#21884

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/ftp-chunk-symlink
Closed

ftplistparser: clear strings.target if not symlink#21884
bagder wants to merge 1 commit into
masterfrom
bagder/ftp-chunk-symlink

Conversation

@bagder

@bagder bagder commented Jun 6, 2026

Copy link
Copy Markdown
Member

When the struct is passed to the CURLOPT_CHUNK_BGN_FUNCTION callback, clear the pointer if the provided data is not a symlink.

When the struct is passed to the CURLOPT_CHUNK_BGN_FUNCTION callback,
clear the pointer if the provided data is not a symlink.
@bagder bagder added the FTP label Jun 6, 2026
@bagder bagder marked this pull request as ready for review June 6, 2026 21:39
@bagder bagder requested a review from Copilot June 6, 2026 22:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the FTP LIST parser’s population of struct curl_fileinfo so that strings.target is only set when the parsed entry is actually a symlink, matching the intended semantics for data exposed to CURLOPT_CHUNK_BGN_FUNCTION.

Changes:

  • Gate finfo->strings.target assignment on finfo->filetype == CURLFILETYPE_SYMLINK.
  • Prevent stale symlink_target offsets from leaking a non-NULL strings.target pointer for non-symlink entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/ftplistparser.c
Comment thread lib/ftplistparser.c
@bagder bagder closed this in 317bf7e Jun 6, 2026
@bagder bagder deleted the bagder/ftp-chunk-symlink branch June 6, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants