summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2013-02-24 21:51:04 +0100
committerSebastian Berg <sebastian@sipsolutions.net>2013-03-01 18:29:07 +0100
commite12dc1cf32daa3e9f19295e985b640e3a04f96ea (patch)
tree447198f73f5367a2930f7bedfd10dffa2b4ee0cd /numpy/core/src
parentd111fbdc1e7da219e4a30b8abd3f710b57116635 (diff)
downloadnumpy-e12dc1cf32daa3e9f19295e985b640e3a04f96ea.tar.gz
BUG: initialize op_axes when only itershape is given
In this case, the initialization used the number of dimensions instead of setting it to NULL for each operand, leading to possible segmentation faults.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/multiarray/nditer_pywrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c
index fd88cdbc7..4621491a3 100644
--- a/numpy/core/src/multiarray/nditer_pywrap.c
+++ b/numpy/core/src/multiarray/nditer_pywrap.c
@@ -786,7 +786,7 @@ npyiter_init(NewNpyArrayIterObject *self, PyObject *args, PyObject *kwds)
if (itershape.len > 0) {
if (oa_ndim == 0) {
oa_ndim = itershape.len;
- memset(op_axes, 0, sizeof(op_axes[0])*oa_ndim);
+ memset(op_axes, 0, sizeof(op_axes[0]) * nop);
}
else if (oa_ndim != itershape.len) {
PyErr_SetString(PyExc_ValueError,