summaryrefslogtreecommitdiffstats
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-28 15:23:07 (GMT)
committerGitHub <noreply@github.com>2019-05-28 15:23:07 (GMT)
commit80dfe990162e7a2dd99524829beecd449a973e9e (patch)
tree832d950900b92fdfe368a85c31686219a0ccb56d /Objects/typeobject.c
parentd9d1045837e5356331b6d5e24cbd1286acb62b5d (diff)
downloadcpython-80dfe990162e7a2dd99524829beecd449a973e9e.zip
cpython-80dfe990162e7a2dd99524829beecd449a973e9e.tar.gz
cpython-80dfe990162e7a2dd99524829beecd449a973e9e.tar.bz2
bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606) (GH-13625)
Fix possible overflow in wrap_lenfunc() when sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows). (cherry picked from commit 05f16416d99dc9fc76fef11e56f16593e7a5955e)
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 56277cf..1c8958c 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4398,7 +4398,7 @@ wrap_lenfunc(PyObject *self, PyObject *args, void *wrapped)
res = (*func)(self);
if (res == -1 && PyErr_Occurred())
return NULL;
- return PyInt_FromLong((long)res);
+ return PyInt_FromSsize_t(res);
}
static PyObject *