Merged revisions 88550 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88550 | antoine.pitrou | 2011-02-24 21:50:49 +0100 (jeu., 24 févr. 2011) | 4 lines

  Issue #11286: Raise a ValueError from calling PyMemoryView_FromBuffer with
  a buffer struct having a NULL data pointer.
........
This commit is contained in:
Antoine Pitrou 2011-02-24 20:53:48 +00:00
parent ec8f0df229
commit 915605c59a
4 changed files with 21 additions and 0 deletions

View file

@ -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)