summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/umath/ufunc_object.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 9b4f90a0e..6c18f51bf 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -1436,6 +1436,9 @@ execute_legacy_ufunc_loop(PyUFuncObject *ufunc,
PyArray_ISFORTRAN(op[0]) ?
NPY_ARRAY_F_CONTIGUOUS : 0,
NULL);
+ if (op[1] == NULL) {
+ return -1;
+ }
/* Call the __prepare_array__ if necessary */
if (prepare_ufunc_output(ufunc, &op[1],
@@ -1488,6 +1491,9 @@ execute_legacy_ufunc_loop(PyUFuncObject *ufunc,
PyArray_ISFORTRAN(tmp) ?
NPY_ARRAY_F_CONTIGUOUS : 0,
NULL);
+ if (op[2] == NULL) {
+ return -1;
+ }
/* Call the __prepare_array__ if necessary */
if (prepare_ufunc_output(ufunc, &op[2],