This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author izbyshev
Recipients izbyshev, levkivskyi, methane, serhiy.storchaka
Date 2018-08-20.13:41:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534772471.92.0.56676864532.issue34441@psf.upfronthosting.co.za>
In-reply-to
Content
>>> from abc import ABCMeta
>>> class S(metaclass=ABCMeta):
...   __subclasses__ = None
... 
>>> issubclass(int, S)
Segmentation fault (core dumped)

This is the result of missing NULL check for 'subclasses' in _abc__abc_subclasscheck_impl (Modules/_abc.c):

    /* 6. Check if it's a subclass of a subclass (recursive). */
    subclasses = PyObject_CallMethod(self, "__subclasses__", NULL);
    if (!PyList_Check(subclasses)) {
        PyErr_SetString(PyExc_TypeError, "__subclasses__() must return a list");
        goto end;
    }

Reported by Svace static analyzer.
History
Date User Action Args
2018-08-20 13:41:11izbyshevsetrecipients: + izbyshev, methane, serhiy.storchaka, levkivskyi
2018-08-20 13:41:11izbyshevsetmessageid: <1534772471.92.0.56676864532.issue34441@psf.upfronthosting.co.za>
2018-08-20 13:41:11izbyshevlinkissue34441 messages
2018-08-20 13:41:11izbyshevcreate