Skip to content

ftp: return better on OOM in two places - #20099

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

bagder wants to merge 1 commit into
masterfrom
bagder/ftp-oom

Conversation

@bagder

@bagder bagder commented Dec 26, 2025

Copy link
Copy Markdown
Member

Found with strict torture testing.

Found with strict torture testing.
@bagder bagder added the FTP label Dec 26, 2025
@bagder
bagder requested a review from Copilot December 26, 2025 09:29
@bagder
bagder marked this pull request as ready for review December 26, 2025 09:29

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 improves error handling in the FTP implementation by ensuring proper early returns when out-of-memory (OOM) errors occur. The changes prevent execution of potentially risky operations when memory allocation has failed, found through strict torture testing.

  • Added OOM check before attempting EPSV fallback to prevent resource cleanup with invalid state
  • Added early return for OOM errors during secondary socket connection to avoid potential undefined behavior

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

Comment thread lib/ftp.c Resolved
@bagder

bagder commented Dec 26, 2025

Copy link
Copy Markdown
Member Author

augment review

@augmentcode

augmentcode Bot commented Dec 26, 2025

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Improve FTP out-of-memory handling by avoiding protocol-fallback paths that would mask OOM.
Changes: Skip EPSV-disable retry logic on OOM and return early when Curl_conn_connect() reports CURLE_OUT_OF_MEMORY.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot 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.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@bagder bagder closed this in abcb10f Dec 26, 2025
@bagder
bagder deleted the bagder/ftp-oom branch December 26, 2025 09:49
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