summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS6
-rw-r--r--Modules/_ctypes/_ctypes.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 04aa21fccf..77e97f0509 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,8 +12,6 @@ What's New in Python 2.5.2c1?
Core and builtins
-----------------
-- Prevent a segfault when a ctypes NULL function pointer is called.
-
- Bug #1517: Possible segfault in lookup().
- Issue #1638: %zd configure test fails on Linux.
@@ -171,6 +169,10 @@ Library
Extension Modules
-----------------
+- Fix a potential 'SystemError: NULL result without error' in _ctypes.
+
+- Prevent a segfault when a ctypes NULL function pointer is called.
+
- Bug #1301: Bad assert in _tkinter fixed.
- Patch #1114: fix curses module compilation on 64-bit AIX, & possibly
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 47fab8a00a..fe772acc5c 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -2896,7 +2896,7 @@ CFuncPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|| PyLong_Check(PyTuple_GET_ITEM(args, 0)))) {
CDataObject *ob;
void *ptr = PyLong_AsVoidPtr(PyTuple_GET_ITEM(args, 0));
- if (ptr == NULL)
+ if (ptr == NULL && PyErr_Occurred())
return NULL;
ob = (CDataObject *)GenericCData_new(type, args, kwds);
if (ob == NULL)