Commit 0a748439 authored by Thomas Heller's avatar Thomas Heller

Fix for SF# 1649098: avoid zero-sized array declaration in structure.

parent 799383f0
...@@ -268,7 +268,7 @@ ffi_info *AllocFunctionCallback(PyObject *callable, ...@@ -268,7 +268,7 @@ ffi_info *AllocFunctionCallback(PyObject *callable,
ffi_abi cc; ffi_abi cc;
nArgs = PySequence_Size(converters); 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) { if (p == NULL) {
PyErr_NoMemory(); PyErr_NoMemory();
return NULL; return NULL;
......
...@@ -74,7 +74,7 @@ typedef struct { ...@@ -74,7 +74,7 @@ typedef struct {
PyObject *callable; PyObject *callable;
SETFUNC setfunc; SETFUNC setfunc;
ffi_type *restype; ffi_type *restype;
ffi_type *atypes[0]; ffi_type *atypes[1];
} ffi_info; } ffi_info;
typedef struct { typedef struct {
......
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