[issue33742] Unsafe memory access in PyStructSequence_InitType

2018-06-04 Thread Pasha Stetsenko
Pasha Stetsenko added the comment: The code is simple: ``` // first initialize PyStructSequence_Field* fields; then: PyTypeObject* type = malloc(sizeof(PyTypeObject)); PyStructSequence_InitType(type, desc); ``` Of course, `malloc` can accidentally allocate memory that is already filled with

[issue33742] Unsafe memory access in PyStructSequence_InitType

2018-06-02 Thread Pasha Stetsenko
New submission from Pasha Stetsenko : The documentation (https://docs.python.org/3/c-api/tuple.html) for `PyStructSequence_InitType` describes the function as follows: > void PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc > *desc) > Initializes a struct sequ