diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-28 06:17:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-28 06:17:43 -0700 |
commit | e7ddf586ae5b7a3b975103b09c8202226d77f421 (patch) | |
tree | 78bcb43ea072ca1e29a33f23bfaf55bc3b34f8d3 /Objects | |
parent | 1cfb90b69f0239ca8763725ddb01e206b74cb901 (diff) | |
download | cpython-git-e7ddf586ae5b7a3b975103b09c8202226d77f421.tar.gz |
bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606)
Fix possible overflow in wrap_lenfunc() when
sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows).
(cherry picked from commit 05f16416d99dc9fc76fef11e56f16593e7a5955e)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 9dba45ac6f..3092e98f6b 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5454,7 +5454,7 @@ wrap_lenfunc(PyObject *self, PyObject *args, void *wrapped) res = (*func)(self); if (res == -1 && PyErr_Occurred()) return NULL; - return PyLong_FromLong((long)res); + return PyLong_FromSsize_t(res); } static PyObject * |