mirror of https://github.com/python/cpython
Fix fishy sizeof(Py_ssize_t *).
sizeof(Py_ssize_t *) == sizeof(Py_ssize_t) but it's not a portable assumption. CID 486403
This commit is contained in:
parent
e91ad501c5
commit
abfc4d838a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue