From: Thomas Heller Date: Fri, 13 Jul 2007 17:33:13 +0000 (+0000) Subject: Fix for SF# 1649098: avoid zero-sized array declaration in structure. X-Git-Tag: v2.5.2c1~241 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9a8544567e8c96eba92d7e994d887481432d775;p=thirdparty%2FPython%2Fcpython.git Fix for SF# 1649098: avoid zero-sized array declaration in structure. --- diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c index e332f00e8c72..65bdbb58391c 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 0af785102083..7fc2d8109b25 100644 --- a/Modules/_ctypes/ctypes.h +++ b/Modules/_ctypes/ctypes.h @@ -74,7 +74,7 @@ typedef struct { PyObject *callable; SETFUNC setfunc; ffi_type *restype; - ffi_type *atypes[0]; + ffi_type *atypes[1]; } ffi_info; typedef struct {