There was an error while loading. Please reload this page.
1 parent 92e7c7f commit cd04db0Copy full SHA for cd04db0
3 files changed
Lib/test/test_mmap.py
@@ -713,6 +713,17 @@ def test_weakref(self):
713
gc_collect()
714
self.assertIs(wr(), None)
715
716
+ def test_resize_past_pos(self):
717
+ m = mmap.mmap(-1, 8192)
718
+ self.addCleanup(m.close)
719
+ m.read(5000)
720
+ m.resize(4096)
721
+ self.assertEqual(m.read(14), b'')
722
+ self.assertRaises(ValueError, m.read_byte,)
723
+ self.assertRaises(ValueError, m.write_byte, 42)
724
+ self.assertRaises(ValueError, m.write, b'abc')
725
+
726
727
class LargeMmapTests(unittest.TestCase):
728
729
def setUp(self):
Misc/NEWS
@@ -94,6 +94,9 @@ Library
94
- Issue #28322: Fixed possible crashes when unpickle itertools objects from
95
incorrect pickle data. Based on patch by John Leitch.
96
97
+- Fix possible integer overflows and crashes in the mmap module with unusual
98
+ usage patterns.
99
100
- Issue #1703178: Fix the ability to pass the --link-objects option to the
101
distutils build_ext command.
102
0 commit comments