Fix for SF# 1649098: avoid zero-sized array declaration in structure.
diff --git a/Misc/NEWS b/Misc/NEWS
index aa02388..c4f0eee 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -708,6 +708,9 @@
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 c57dc07..18af288 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -268,7 +268,7 @@
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 @@
PyObject *callable;
SETFUNC setfunc;
ffi_type *restype;
- ffi_type *atypes[0];
+ ffi_type *atypes[1];
} ffi_info;
typedef struct {