From f9a8544567e8c96eba92d7e994d887481432d775 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Fri, 13 Jul 2007 17:33:13 +0000 Subject: [PATCH] Fix for SF# 1649098: avoid zero-sized array declaration in structure. --- Modules/_ctypes/callbacks.c | 2 +- Modules/_ctypes/ctypes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c index e332f00e8c..65bdbb5839 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 0af7851020..7fc2d8109b 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 { -- 2.40.0