diff Objects/memoryobject.c @ 64360:925e9113f0aa

Issue #9737: Fix a crash when trying to delete a slice or an item from a memoryview object.
author Antoine Pitrou <solipsis@pitrou.net>
date Wed, 01 Sep 2010 21:14:16 +0000
parents d24870d00c42
children 7a395bceac91
line wrap: on
line diff
--- a/Objects/memoryobject.c	Wed Sep 01 21:02:50 2010 +0000
+++ b/Objects/memoryobject.c	Wed Sep 01 21:14:16 2010 +0000
@@ -631,6 +631,11 @@
             "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;