New submission from Ziyue Jiang <ziyue.jian...@gmail.com>:

The type_mro_modified() function in Object/typeobject.c may produce double 
Py_XDECREF on mro_meth and type_mro_meth when enter the code:
if (!_PyType_HasFeature(cls, Py_TPFLAGS_HAVE_VERSION_TAG) ||
!PyType_IsSubtype(type, cls)) {
    goto clear;
}


I think 
mro_meth = NULL;
type_mro_meth = NULL;
should be added after the first time Py_XDECREF them.

----------
components: C API
messages: 397188
nosy: Wesley-Jzy
priority: normal
severity: normal
status: open
title: Possible double Py_XDECREF in cpython typeobject.c
type: crash
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44588>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to