summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-02-17 10:12:10 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-02-17 10:12:10 (GMT)
commitf6bbd0e71d986e0acefb4b3708d9129a9bce4a17 (patch)
treea33dde057c2b37a0472d785136a21749e201a5ac /Modules
parentf68b5b804675326fb05e20b3f327bd774fa95d09 (diff)
downloadcpython-f6bbd0e71d986e0acefb4b3708d9129a9bce4a17.zip
cpython-f6bbd0e71d986e0acefb4b3708d9129a9bce4a17.tar.gz
cpython-f6bbd0e71d986e0acefb4b3708d9129a9bce4a17.tar.bz2
Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mmapmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index a03957c..df2c058 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -731,7 +731,7 @@ mmap_subscript(mmap_object *self, PyObject *item)
return NULL;
if (i < 0)
i += self->size;
- if (i < 0 || (size_t)i > self->size) {
+ if (i < 0 || (size_t)i >= self->size) {
PyErr_SetString(PyExc_IndexError,
"mmap index out of range");
return NULL;
@@ -872,7 +872,7 @@ mmap_ass_subscript(mmap_object *self, PyObject *item, PyObject *value)
return -1;
if (i < 0)
i += self->size;
- if (i < 0 || (size_t)i > self->size) {
+ if (i < 0 || (size_t)i >= self->size) {
PyErr_SetString(PyExc_IndexError,
"mmap index out of range");
return -1;