You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Argument Clinic: Py_buffer parameters are not initialized #64341
Argument Clinic doesn't initialize Py_buffer parameters. It generates cleanup code:
/* Cleanup for data */if (data.buf)
PyBuffer_Release(&data);
And if PyArg_ParseTuple() is failed, the buf attribute can contains arbitrary (non-NULL) data. This causes crash in PyBuffer_Release(). See bpo-20133 for working example.
Activity
serhiy-storchaka commentedon Jan 6, 2014
Argument Clinic doesn't initialize Py_buffer parameters. It generates cleanup code:
And if PyArg_ParseTuple() is failed, the buf attribute can contains arbitrary (non-NULL) data. This causes crash in PyBuffer_Release(). See bpo-20133 for working example.
larryhastings commentedon Jan 6, 2014
Here's a patch, please review. You can see how Py_buffer variables are initialized in zlibmodule.c in the patch.
serhiy-storchaka commentedon Jan 6, 2014
LGTM.
But is not {NULL} enough for Py_buffer initialization?
serhiy-storchaka commentedon Jan 6, 2014
Or perhaps we should introduce macros Py_buffer_INIT.
python-dev commentedon Jan 6, 2014
New changeset 16ff19d1d367 by Larry Hastings in branch 'default':
Issue bpo-20142: Py_buffer variables generated by Argument Clinic are now
http://hg.python.org/cpython/rev/16ff19d1d367