Skip to content

url: return error at once when OOM in netrc handling - #20103

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

url: return error at once when OOM in netrc handling#20103
bagder wants to merge 1 commit into
masterfrom
bagder/netrc-oom

Conversation

@bagder

@bagder bagder commented Dec 27, 2025

Copy link
Copy Markdown
Member

No description provided.

@bagder
bagder requested a review from Copilot December 27, 2025 22:36
@bagder
bagder marked this pull request as ready for review December 27, 2025 22:37

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 fixes incorrect error handling for out-of-memory conditions in netrc file parsing. Previously, OOM errors from Curl_parsenetrc() would be incorrectly returned as CURLE_READ_ERROR. The fix adds an early check that immediately returns CURLE_OUT_OF_MEMORY when memory allocation fails during netrc parsing.

  • Adds explicit handling for NETRC_OUT_OF_MEMORY error code
  • Returns the appropriate CURLE_OUT_OF_MEMORY error instead of incorrectly mapping to CURLE_READ_ERROR

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

@bagder

bagder commented Dec 27, 2025

Copy link
Copy Markdown
Member Author

augment review

@augmentcode

augmentcode Bot commented Dec 27, 2025

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Treat NETRC_OUT_OF_MEMORY from Curl_parsenetrc() as a hard failure and return CURLE_OUT_OF_MEMORY immediately.

Why: Prevents OOM during .netrc handling from being misreported as a generic read error and allows callers to react appropriately.

🤖 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 2754e0f Dec 29, 2025
@bagder
bagder deleted the bagder/netrc-oom branch December 29, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants