diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-14 23:12:17 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-14 23:12:17 (GMT) |
commit | 78980438683d98076cd541d995a868fb5c9e4277 (patch) | |
tree | 6003323bfe4c38f0d9ca17f126fbcdf782752600 /Modules/_ctypes | |
parent | 5f1cfbb5c056564e2692d2abcdc82f1944a3b2ec (diff) | |
download | cpython-78980438683d98076cd541d995a868fb5c9e4277.zip cpython-78980438683d98076cd541d995a868fb5c9e4277.tar.gz cpython-78980438683d98076cd541d995a868fb5c9e4277.tar.bz2 |
Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r-- | Modules/_ctypes/stgdict.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c index e5b0e4c..25d9996 100644 --- a/Modules/_ctypes/stgdict.c +++ b/Modules/_ctypes/stgdict.c @@ -335,7 +335,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct isPacked = PyObject_GetAttrString(type, "_pack_"); if (isPacked) { - pack = PyLong_AsLong(isPacked); + pack = _PyLong_AsInt(isPacked); if (pack < 0 || PyErr_Occurred()) { Py_XDECREF(isPacked); PyErr_SetString(PyExc_ValueError, |