Skip to content

ftp: avoid accessing EPSV response one byte past the NULL#21545

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

ftp: avoid accessing EPSV response one byte past the NULL#21545
bagder wants to merge 1 commit into
masterfrom
bagder/ftp-epsv

Conversation

@bagder

@bagder bagder commented May 10, 2026

Copy link
Copy Markdown
Member

If the response is just a single "(".

Reported-by: Andrew Nesbit

If the response is just a single "(".

Reported-by: Andrew Nesbit
@bagder bagder added the FTP label May 10, 2026
@bagder bagder marked this pull request as ready for review May 11, 2026 06:03
@bagder bagder requested a review from Copilot May 11, 2026 06:03

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 hardens FTP EPSV (229) response parsing in lib/ftp.c to avoid reading one byte past the terminating NUL when the server reply contains only a single "(" with no delimiter/port payload.

Changes:

  • Add a guard (sep must be non-NUL) before accessing ptr[1], ptr[2], and ptr[3] in the EPSV reply parser.

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

@bagder bagder closed this in 6f1dfab May 11, 2026
@bagder bagder deleted the bagder/ftp-epsv branch May 11, 2026 06:07
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
If the response is just a single "(".

Reported-by: Andrew Nesbit
Closes curl#21545
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