Staging
v0.5.1
https://github.com/python/cpython
Revision 526ef856dd598fd3cefdfadeb18ede7a8e57aa41 authored by Pablo Galindo on 08 October 2019, 20:38:11 UTC, committed by GitHub on 08 October 2019, 20:38:11 UTC
The implementation of weakref.proxy's methods call back into the Python
API using a borrowed references of the weakly referenced object
(acquired via PyWeakref_GET_OBJECT). This API call may delete the last
reference to the object (either directly or via GC), leaving a dangling
pointer, which can be subsequently dereferenced.

To fix this, claim a temporary ownership of the referenced object when
calling the appropriate method. Some functions because at the moment they
do not need to access the borrowed referent, but to protect against
future changes to these functions, ownership need to be fixed in
all potentially affected methods..
(cherry picked from commit 10cd00a9e3c22af37c748ea5a417f6fb66601e21)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
1 parent 7162440
History
Tip revision: 526ef856dd598fd3cefdfadeb18ede7a8e57aa41 authored by Pablo Galindo on 08 October 2019, 20:38:11 UTC
[3.8] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16662)
Tip revision: 526ef85
File Mode Size
.azure-pipelines
.github
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
m4
.gitattributes -rw-r--r-- 1.8 KB
.gitignore -rw-r--r-- 1.7 KB
.travis.yml -rw-r--r-- 8.1 KB
CODE_OF_CONDUCT.md -rw-r--r-- 630 bytes
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 65.6 KB
README.rst -rw-r--r-- 9.9 KB
aclocal.m4 -rw-r--r-- 10.7 KB
config.guess -rwxr-xr-x 43.1 KB
config.sub -rwxr-xr-x 35.4 KB
configure -rwxr-xr-x 491.7 KB
configure.ac -rw-r--r-- 162.3 KB
install-sh -rwxr-xr-x 15.0 KB
pyconfig.h.in -rw-r--r-- 44.1 KB
setup.py -rw-r--r-- 101.7 KB

README.rst

back to top