diff options
author | Thomas Heller <theller@ctypes.org> | 2007-07-13 17:46:54 +0000 |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2007-07-13 17:46:54 +0000 |
commit | ef4fff34351defce057bd45135341fb10557b4f3 (patch) | |
tree | 4aaf82d106b4f7410824a155bb0d083f8c3d36dd | |
parent | fa704c6adef703271844349bad94fbf7d09143d9 (diff) | |
download | cpython-git-ef4fff34351defce057bd45135341fb10557b4f3.tar.gz |
Fix for SF# 1649098: avoid zero-sized array declaration in structure.
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/_ctypes/callbacks.c | 2 | ||||
-rw-r--r-- | Modules/_ctypes/ctypes.h | 2 |
3 files changed, 5 insertions, 2 deletions
@@ -708,6 +708,9 @@ Library Extension Modules ----------------- +- Bug #1649098: Avoid declaration of zero-sized array declaration in + structure. + - Removed the rgbimg module; been deprecated since Python 2.5. - Bug #1721309: prevent bsddb module from freeing random memory. diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c index c57dc07be2..18af288ce2 100644 --- a/Modules/_ctypes/callbacks.c +++ b/Modules/_ctypes/callbacks.c @@ -268,7 +268,7 @@ ffi_info *AllocFunctionCallback(PyObject *callable, ffi_abi cc; nArgs = PySequence_Size(converters); - p = (ffi_info *)PyMem_Malloc(sizeof(ffi_info) + sizeof(ffi_type) * (nArgs + 1)); + p = (ffi_info *)PyMem_Malloc(sizeof(ffi_info) + sizeof(ffi_type) * (nArgs)); if (p == NULL) { PyErr_NoMemory(); return NULL; diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h index 5846e3fc59..bf2bdaa6ff 100644 --- a/Modules/_ctypes/ctypes.h +++ b/Modules/_ctypes/ctypes.h @@ -75,7 +75,7 @@ typedef struct { PyObject *callable; SETFUNC setfunc; ffi_type *restype; - ffi_type *atypes[0]; + ffi_type *atypes[1]; } ffi_info; typedef struct { |