mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
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).
This commit is contained in:
parent
04530812e9
commit
05f16416d9
3 changed files with 7 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue