Skip to content

[3.15] gh-159739: Propagate fallback getaddrinfo allocation failures (GH-159984) - #160099

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-7c39e8f-3.15
Open

miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-7c39e8f-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

On builds using CPython's fallback getaddrinfo(), an allocation failure while constructing address results can return success with a null result, and the canonical-name path can ignore a helper error. socket.getaddrinfo() can then return an empty list, other callers can crash when they dereference the null result, and partially built address lists may leak. Set EAI_MEMORY, propagate helper errors, and keep the partial list available for cleanup.
(cherry picked from commit 7c39e8f)

Co-authored-by: Jelle Zijlstra jelle@openai.com

…ythonGH-159984)

On builds using CPython's fallback `getaddrinfo()`, an allocation failure while constructing address results can return success with a null result, and the canonical-name path can ignore a helper error. `socket.getaddrinfo()` can then return an empty list, other callers can crash when they dereference the null result, and partially built address lists may leak. Set `EAI_MEMORY`, propagate helper errors, and keep the partial list available for cleanup.
(cherry picked from commit 7c39e8f)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants