summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-05-28 06:55:29 -0600
committerVictor Stinner <vstinner@redhat.com>2019-05-28 14:55:28 +0200
commit05f16416d99dc9fc76fef11e56f16593e7a5955e (patch)
treea440208f390b4c412ec28ceba4a508a6218a4075 /Lib
parent04530812e90e45a37ed84e83505d63db7edc1262 (diff)
downloadcpython-git-05f16416d99dc9fc76fef11e56f16593e7a5955e.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).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_descr.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index e37a98417f..6b018ccc56 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -389,6 +389,10 @@ class OperatorsTest(unittest.TestCase):
a.setstate(100)
self.assertEqual(a.getstate(), 100)
+ def test_wrap_lenfunc_bad_cast(self):
+ self.assertEqual(range(sys.maxsize).__len__(), sys.maxsize)
+
+
class ClassPropertiesAndMethods(unittest.TestCase):
def assertHasAttr(self, obj, name):