Kaydet (Commit) f43a86b9 authored tarafından Thomas Heller's avatar Thomas Heller

Backport from trunk:

  Fix a potential 'SystemError: NULL result without error'.
  NULL may be a valid return value from PyLong_AsVoidPtr.
Also move an older ctypes NEWS item in the correct category.
üst 2e7fde70
...@@ -12,8 +12,6 @@ What's New in Python 2.5.2c1? ...@@ -12,8 +12,6 @@ What's New in Python 2.5.2c1?
Core and builtins Core and builtins
----------------- -----------------
- Prevent a segfault when a ctypes NULL function pointer is called.
- Bug #1517: Possible segfault in lookup(). - Bug #1517: Possible segfault in lookup().
- Issue #1638: %zd configure test fails on Linux. - Issue #1638: %zd configure test fails on Linux.
...@@ -171,6 +169,10 @@ Library ...@@ -171,6 +169,10 @@ Library
Extension Modules 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. - Bug #1301: Bad assert in _tkinter fixed.
- Patch #1114: fix curses module compilation on 64-bit AIX, & possibly - Patch #1114: fix curses module compilation on 64-bit AIX, & possibly
......
...@@ -2896,7 +2896,7 @@ CFuncPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -2896,7 +2896,7 @@ CFuncPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|| PyLong_Check(PyTuple_GET_ITEM(args, 0)))) { || PyLong_Check(PyTuple_GET_ITEM(args, 0)))) {
CDataObject *ob; CDataObject *ob;
void *ptr = PyLong_AsVoidPtr(PyTuple_GET_ITEM(args, 0)); void *ptr = PyLong_AsVoidPtr(PyTuple_GET_ITEM(args, 0));
if (ptr == NULL) if (ptr == NULL && PyErr_Occurred())
return NULL; return NULL;
ob = (CDataObject *)GenericCData_new(type, args, kwds); ob = (CDataObject *)GenericCData_new(type, args, kwds);
if (ob == NULL) if (ob == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment