Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 6fecaf5..e1e5967 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -41,6 +41,10 @@
self.assertEqual(m[0], '\0')
self.assertEqual(m[0:3], '\0\0\0')
+ # Shouldn't crash on boundary (Issue #5292)
+ self.assertRaises(IndexError, m.__getitem__, len(m))
+ self.assertRaises(IndexError, m.__setitem__, len(m), '\0')
+
# Modify the file's content
m[0] = '3'
m[PAGESIZE +3: PAGESIZE +3+3] = 'bar'