forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-100795: Don't call freeaddrinfo on failure. (pythonGH-101252)
When getaddrinfo returns an error, the output pointer is in an unknown state Don't call freeaddrinfo on it. See the issue for discussion and details with links to reasoning. _Most_ libc getaddrinfo implementations never modify the output pointer unless they are returning success. (cherry picked from commit b724ac2) Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Sergey G. Brester <github@sebres.de> Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
- Loading branch information
1 parent
e24c73e
commit a28aa6e
Showing
2 changed files
with
7 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Library/2023-01-21-16-50-22.gh-issue-100795.NPMZf7.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Avoid potential unexpected ``freeaddrinfo`` call (double free) in :mod:`socket` | ||
when when a libc ``getaddrinfo()`` implementation leaves garbage in an output | ||
pointer when returning an error. Original patch by Sergey G. Brester. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters