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

Merged
miss-islington opened 2:03pm on October 21, 2026 wanted to merge 1 commit into python/cpython 3.14 from
backport-7c39e8f-3.14
miss-islington authored
of work during October 21
Diff Delta:
0
About 0 Diff Delta/hour
Classified as:  Bug Fix

miss-islington's Description of Work

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 7c39e8fabbb5735dffdf97021167aa22bd55e30c)

Co-authored-by: Jelle Zijlstra [email protected]


  • Issue: gh-159739
    <!-- /gh-issue-number -->

2 total changed files
(1 file ignored)
Loading changes...
PR terminus reached:
Thus concludes todayโ€™s episode of โ€œJust One Small Changeโ€