From: Christian Heimes Date: Sat, 20 Jul 2013 12:11:52 +0000 (+0200) Subject: Fix fishy sizeof(Py_ssize_t *). X-Git-Tag: v3.4.0a1~138 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abfc4d838aed12ca650cf764fc7ac2ae1d778036;p=thirdparty%2FPython%2Fcpython.git Fix fishy sizeof(Py_ssize_t *). sizeof(Py_ssize_t *) == sizeof(Py_ssize_t) but it's not a portable assumption. CID 486403 --- diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index c1956945c9de..62a083b33d3a 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;