From 14514d9084a40f599c57da853a305aa264562a43 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Fri, 17 May 2019 01:13:03 -0600 Subject: bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375) The final addition (cur += step) may overflow, so use size_t for "cur". "cur" is always positive (even for negative steps), so it is safe to use size_t here. Co-Authored-By: Martin Panter --- Lib/test/string_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/test/string_tests.py') diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 836a43b81d..38da941f7f 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -1135,7 +1135,7 @@ class MixinStrUnicodeUserStringTest: def test_extended_getslice(self): # Test extended slicing by comparing with list slicing. s = string.ascii_letters + string.digits - indices = (0, None, 1, 3, 41, -1, -2, -37) + indices = (0, None, 1, 3, 41, sys.maxsize, -1, -2, -37) for start in indices: for stop in indices: # Skip step 0 (invalid) -- cgit v1.2.1