mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #11286: Raise a ValueError from calling PyMemoryView_FromBuffer with
a buffer struct having a NULL data pointer.
This commit is contained in:
parent
1ce92dc20d
commit
5bffa79c22
4 changed files with 21 additions and 0 deletions
|
@ -75,6 +75,11 @@ PyMemoryView_FromBuffer(Py_buffer *info)
|
|||
{
|
||||
PyMemoryViewObject *mview;
|
||||
|
||||
if (info->buf == NULL) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"cannot make memory view from a buffer with a NULL data pointer");
|
||||
return NULL;
|
||||
}
|
||||
mview = (PyMemoryViewObject *)
|
||||
PyObject_GC_New(PyMemoryViewObject, &PyMemoryView_Type);
|
||||
if (mview == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue