[New-bugs-announce] [issue25902] Fixed various refcount issues in ElementTree iteration

Serhiy Storchaka report at bugs.python.org
Fri Dec 18 07:04:44 EST 2015


New submission from Serhiy Storchaka:

ElementTree iteration code holds borrowed references when call user code (comparison with the tag, concatenating text and tail lazy lists, testing text and tail for empty). User code can make borrowed references invalid and this can lead to a crash. One example is provided by Martin in msg256495. Other possible cases can be more hard to reproduce.

Proposed patch makes iterating code to own references that it operates.

----------
components: Extension Modules, XML
files: etree_iter_refcount.patch
keywords: patch
messages: 256673
nosy: martin.panter, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fixed various refcount issues in ElementTree iteration
type: crash
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41352/etree_iter_refcount.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25902>
_______________________________________


More information about the New-bugs-announce mailing list