From abfc4d838aed12ca650cf764fc7ac2ae1d778036 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 20 Jul 2013 14:11:52 +0200 Subject: [PATCH] Fix fishy sizeof(Py_ssize_t *). sizeof(Py_ssize_t *) == sizeof(Py_ssize_t) but it's not a portable assumption. CID 486403 --- Modules/_ctypes/_ctypes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index c1956945c9d..62a083b33d3 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1326,7 +1326,7 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (stgdict->format == NULL) goto error; stgdict->ndim = itemdict->ndim + 1; - stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t *) * stgdict->ndim); + stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t) * stgdict->ndim); if (stgdict->shape == NULL) goto error; stgdict->shape[0] = length;