summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-02-27 18:24:25 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-02-27 18:24:25 +0000
commitdef1c92c288699c65356e52722487bbacc036343 (patch)
tree9ab393e99e036d0fed47850d631efd21416b4841 /numpy/core/src
parent1b3fcc6fdf4572a5b265794d60c798cbc0d0e288 (diff)
downloadnumpy-def1c92c288699c65356e52722487bbacc036343.tar.gz
Fix segfault due to no error check.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/arrayobject.c2
-rw-r--r--numpy/core/src/scalartypes.inc.src3
2 files changed, 1 insertions, 4 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index 212064807..bc0a7abdb 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -3042,8 +3042,8 @@ array_slice(PyArrayObject *self, int ilow, int ihigh)
self->nd, self->dimensions,
self->strides, data,
self->flags, (PyObject *)self);
-
self->dimensions[0] = l;
+ if (r == NULL) return NULL;
r->base = (PyObject *)self;
Py_INCREF(self);
PyArray_UpdateFlags(r, UPDATE_ALL_FLAGS);
diff --git a/numpy/core/src/scalartypes.inc.src b/numpy/core/src/scalartypes.inc.src
index 1f967ac5d..f15f26383 100644
--- a/numpy/core/src/scalartypes.inc.src
+++ b/numpy/core/src/scalartypes.inc.src
@@ -459,11 +459,8 @@ gentype_multiply(PyObject *m1, PyObject *m2)
Py_DECREF(arr);
Py_DECREF(tup);
return ret;
-
}
-
-
/**begin repeat
#name=positive, negative, absolute, invert, int, long, float, oct, hex#