summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-13 17:46:54 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-13 17:46:54 (GMT)
commitef4fff34351defce057bd45135341fb10557b4f3 (patch)
tree4aaf82d106b4f7410824a155bb0d083f8c3d36dd /Modules
parentfa704c6adef703271844349bad94fbf7d09143d9 (diff)
downloadcpython-ef4fff34351defce057bd45135341fb10557b4f3.zip
cpython-ef4fff34351defce057bd45135341fb10557b4f3.tar.gz
cpython-ef4fff34351defce057bd45135341fb10557b4f3.tar.bz2
Fix for SF# 1649098: avoid zero-sized array declaration in structure.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/callbacks.c2
-rw-r--r--Modules/_ctypes/ctypes.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index c57dc07..18af288 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 5846e3f..bf2bdaa 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 {