diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-01 21:14:16 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-01 21:14:16 (GMT) |
commit | e0793ba99293ac9df5e7e27d3f78cfc27113b359 (patch) | |
tree | 105cd42e802738644ef74b2963f25a2e2ec2d72b /Objects | |
parent | 6cb5ad035b0eac63fc434c8b9625d28e2f336433 (diff) | |
download | cpython-e0793ba99293ac9df5e7e27d3f78cfc27113b359.zip cpython-e0793ba99293ac9df5e7e27d3f78cfc27113b359.tar.gz cpython-e0793ba99293ac9df5e7e27d3f78cfc27113b359.tar.bz2 |
Issue #9737: Fix a crash when trying to delete a slice or an item from
a memoryview object.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/memoryobject.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index 9a62dd8..3f20392 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -631,6 +631,11 @@ memory_ass_sub(PyMemoryViewObject *self, PyObject *key, PyObject *value) "cannot modify read-only memory"); return -1; } + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, + "cannot delete memory"); + return -1; + } if (view->ndim != 1) { PyErr_SetNone(PyExc_NotImplementedError); return -1; |