[Python-checkins] cpython: Fix fishy sizeof(Py_ssize_t *).
christian.heimes
python-checkins at python.org
Sat Jul 20 14:12:21 CEST 2013
http://hg.python.org/cpython/rev/afd0153e06c1
changeset: 84724:afd0153e06c1
user: Christian Heimes <christian at cheimes.de>
date: Sat Jul 20 14:11:52 2013 +0200
summary:
Fix fishy sizeof(Py_ssize_t *).
sizeof(Py_ssize_t *) == sizeof(Py_ssize_t) but it's not a portable assumption.
CID 486403
files:
Modules/_ctypes/_ctypes.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -1326,7 +1326,7 @@
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;
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list