gh-100795: avoid unexpected freeaddrinfo after failed getaddrinfo#101220
gh-100795: avoid unexpected freeaddrinfo after failed getaddrinfo#101220kumaraditya303 merged 4 commits intopython:mainfrom
freeaddrinfo after failed getaddrinfo#101220Conversation
fixes segfault pythongh-100795 - avoid unexpected `freeaddrinfo` if `res` becomes not NULL during invocation of `getaddrinfo` if it fails
|
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
|
I'll propose the news entry as a PR in your repo after https://github.com/sebres/cpython/tree/fix-gh-100795 gets cloned to my computer so I could branch off it. |
|
Thx!
Why? Can't you push directly to my branch? (since the branch is obviously not protected and it is under PR, GH'd allow to write there, at least python's members should have write rights). But do what you consider to be right. Thanks again. |
Only members of https://github.com/python can push to branches bound to PRs in https://github.com/python/cpython. I'm not a member, just a regular contributor. |
Misc/NEWS.d/next/Library/2023-01-21-16-50-22.gh-issue-100795.NPMZf7.rst
Outdated
Show resolved
Hide resolved
…PMZf7.rst Co-authored-by: Oleg Iarygin <[email protected]>
|
Thanks @sebres for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
gpshead
left a comment
There was a problem hiding this comment.
I'm unsure that this PR is good, see my comment on the issue.
|
GH-101236 is a backport of this pull request to the 3.11 branch. |
|
GH-101237 is a backport of this pull request to the 3.10 branch. |
…rinfo` (pythonGH-101220) (cherry picked from commit 5f08fe4) Co-authored-by: Sergey G. Brester <[email protected]> Co-authored-by: Oleg Iarygin <[email protected]>
…rinfo` (pythonGH-101220) (cherry picked from commit 5f08fe4) Co-authored-by: Sergey G. Brester <[email protected]> Co-authored-by: Oleg Iarygin <[email protected]>
Oh sorry, I just merged it. |
|
I'll revert this, sorry @gpshead. |
… `getaddrinfo` (python#101220)" This reverts commit 5f08fe4.
|
I'm sure that this PR is good, see my comment on the issue. |
This is rebased #101010 to main.
Proposed PR fixes segfault gh-100795 - avoid unexpected
freeaddrinfoifresbecomes not NULL during invocation ofgetaddrinfoif it fails.Previously this could cause double freeing and other hardly reproducible aftereffects, especially in multithreaded environment.
One could surely do
return -1instead ofres = NULL&goto fail(in second case), like incpython/Modules/socketmodule.c
Line 1095 in 5ef90ee
but this way it is minimal invasive (more consistent, remains safe against some merges or future implementations expecting goto fail to free some other handles, etc).