[New-bugs-announce] [issue39903] Double decref in _elementtree.Element.__getstate__

Serhiy Storchaka report at bugs.python.org
Sun Mar 8 08:24:04 EDT 2020


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

There is very strange code in _elementtree.Element.__getstate__ which decrement references to elements of a list before decrementing a reference to the list itself. It happens only if creating a dict fails, so it is almost impossible to reproduce, but if it happens it will likely cause a crash.

The proposed PR fixes the bug and also simplifies the code.

----------
components: Extension Modules, XML
messages: 363657
nosy: eli.bendersky, scoder, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Double decref in _elementtree.Element.__getstate__
type: crash
versions: Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39903>
_______________________________________


More information about the New-bugs-announce mailing list