mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #10451: memoryview objects could allow to mutate a readable buffer.
Initial patch by Ross Lagerwall.
This commit is contained in:
parent
c8a16867f6
commit
ad62b03949
4 changed files with 18 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue