Skip to content

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

Merged
JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-7c39e8f-3.14
Oct 22, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-7c39e8f-3.14

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>
@JelleZijlstra
JelleZijlstra merged commit ffecc6a into python:3.14 Oct 22, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-7c39e8f-3.14 branch October 22, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants