Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect signature for PyObject_AsCharBuffer #34

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 1 comment
Open

Incorrect signature for PyObject_AsCharBuffer #34

GoogleCodeExporter opened this issue Mar 14, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Python 2.5 (and above) changed the signature of PyObject_AsCharBuffer to:

int PyObject_AsCharBuffer(PyObject *obj, const char **buffer, Py_ssize_t 
*buffer_len)

This matters on 64-bit systems, where Py_ssize_t is 64-bits, but int is 
32-bits. The signature in event.pyx is:

    int    PyObject_AsCharBuffer(object obj, char **buffer, int *buffer_len)

This causes the 4-bytes on the stack beside *buffer_len to get clobbered, 
leading to random crashes/corruption.

Original issue reported on code.google.com by [email protected] on 8 Jan 2013 at 5:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant