summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-10-08 16:30:50 +0100
committerGitHub <noreply@github.com>2019-10-08 16:30:50 +0100
commit10cd00a9e3c22af37c748ea5a417f6fb66601e21 (patch)
treeb1f56966388b990f6ac7838f1435ae48ad5c7409 /Python
parent03ab6b4fc6f59a4452756e7a3a46310ce30ec4b2 (diff)
downloadcpython-git-10cd00a9e3c22af37c748ea5a417f6fb66601e21.tar.gz
bpo-38395: Fix ownership in weakref.proxy methods (GH-16632)
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.
Diffstat (limited to 'Python')
0 files changed, 0 insertions, 0 deletions