summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-05-28 12:55:29 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-05-28 12:55:28 (GMT)
commit05f16416d99dc9fc76fef11e56f16593e7a5955e (patch)
treea440208f390b4c412ec28ceba4a508a6218a4075 /Objects
parent04530812e90e45a37ed84e83505d63db7edc1262 (diff)
downloadcpython-05f16416d99dc9fc76fef11e56f16593e7a5955e.zip
cpython-05f16416d99dc9fc76fef11e56f16593e7a5955e.tar.gz
cpython-05f16416d99dc9fc76fef11e56f16593e7a5955e.tar.bz2
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).
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 06e045b..c14cbad 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -5536,7 +5536,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 *