Skip to content

PyType_HasFeature may dereference a NULL pointer #127320

@alonrs

Description

@alonrs

Bug report

Bug description:

In Modules/_testcapi/list.c list_clear function. NULLABLE(obj) may set obj to NULL. Then, it calls PyList_Clear
which in turn calls PyList_Check and then PyType_FastSubclass that calls PyType_HasFeature with type = NULL, which is derefernced here.

A similar phenomenon happens in other Modules/_testcapi/list.c functions as well.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions