summaryrefslogtreecommitdiffstats
path: root/Objects/memoryobject.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-01 21:17:34 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-01 21:17:34 (GMT)
commit9cf85f144e73a1b1566e536436c066cfab32dac8 (patch)
tree45fa67e0eff68a7d0ef456237c4f12200e16c95e /Objects/memoryobject.c
parent54f824f09268ed2475747fbfe810314420b150f7 (diff)
downloadcpython-9cf85f144e73a1b1566e536436c066cfab32dac8.zip
cpython-9cf85f144e73a1b1566e536436c066cfab32dac8.tar.gz
cpython-9cf85f144e73a1b1566e536436c066cfab32dac8.tar.bz2
Merged revisions 84408-84409 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84408 | antoine.pitrou | 2010-09-01 23:14:16 +0200 (mer., 01 sept. 2010) | 4 lines Issue #9737: Fix a crash when trying to delete a slice or an item from a memoryview object. ........ r84409 | antoine.pitrou | 2010-09-01 23:14:46 +0200 (mer., 01 sept. 2010) | 3 lines Fix a compilation warning ........
Diffstat (limited to 'Objects/memoryobject.c')
-rw-r--r--Objects/memoryobject.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index ad16bb2..4997fcc 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -179,7 +179,7 @@ _indirect_copy_nd(char *dest, Py_buffer *view, char fort)
int k;
Py_ssize_t elements;
char *ptr;
- void (*func)(int, Py_ssize_t *, Py_ssize_t *);
+ void (*func)(int, Py_ssize_t *, const Py_ssize_t *);
if (view->ndim > PY_SSIZE_T_MAX / sizeof(Py_ssize_t)) {
PyErr_NoMemory();
@@ -639,6 +639,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;