Issue #10451: memoryview objects could allow to mutate a readable buffer.

Initial patch by Ross Lagerwall.
This commit is contained in:
Antoine Pitrou 2011-01-18 18:57:52 +00:00
parent c8a16867f6
commit ad62b03949
4 changed files with 18 additions and 4 deletions

View file

@ -52,9 +52,6 @@ memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags)
{
int res = 0;
CHECK_RELEASED_INT(self);
/* XXX for whatever reason fixing the flags seems necessary */
if (self->view.readonly)
flags &= ~PyBUF_WRITABLE;
if (self->view.obj != NULL)
res = PyObject_GetBuffer(self->view.obj, view, flags);
if (view)