scipy/backport-BUG-fix-small-refcount-issue-in-ndimage._ctest.patch
WizardHowl 1c85e48848 Fix CVE-2023-25399
Reference: 9b6521198c

Signed-off-by: WizardHowl <liuwenyu7@huawei.com>
2023-07-13 20:37:23 +08:00

32 lines
898 B
Diff

From 133b92679ab23e0fa4a6f3b6e45f493312531024 Mon Sep 17 00:00:00 2001
From: Ralf Gommers <ralf.gommers@gmail.com>
Date: Mon, 13 Jun 2022 20:20:06 +0200
Subject: [PATCH] BUG: fix small refcount issue in `ndimage._ctest`
Note that this is only test code, so it wasn't a real-world problem.
Closes gh-16236
Reference: https://github.com/scipy/scipy/pull/16397/commits/133b92679ab23e0fa4a6f3b6e45f493312531024
Conflict: NA
---
scipy/ndimage/src/_ctest.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scipy/ndimage/src/_ctest.c b/scipy/ndimage/src/_ctest.c
index fe8ce676e..f84ba064a 100644
--- a/scipy/ndimage/src/_ctest.c
+++ b/scipy/ndimage/src/_ctest.c
@@ -93,6 +93,8 @@ py_filter2d(PyObject *obj, PyObject *args)
goto error;
}
callback_data[i] = PyFloat_AsDouble(item);
+ Py_DECREF(item);
+ item = NULL;
if (PyErr_Occurred()) goto error;
}
--
2.33.0