Pasha Stetsenko <stpa...@gmail.com> 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 0s (especially if it is run at the start of the program). So in order to 
make the code exhibit the bug reliably, you can add
```
memset(type, 0xDA, sizeof(PyTypeObject));
```
after the `malloc`.

----------

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

Reply via email to