summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-03-31 20:43:56 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-03-31 20:43:56 (GMT)
commit2ca15013ec4fe77490e3205cd9ed8f9138f786fe (patch)
tree5acec25ceb5391bb772aa2246d184449c7c0755f /Modules/mmapmodule.c
parent33413cbf5ead3de21064a39d162df14dae68231c (diff)
downloadcpython-2ca15013ec4fe77490e3205cd9ed8f9138f786fe.zip
cpython-2ca15013ec4fe77490e3205cd9ed8f9138f786fe.tar.gz
cpython-2ca15013ec4fe77490e3205cd9ed8f9138f786fe.tar.bz2
Merged revisions 70879 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r70879 | hirokazu.yamamoto | 2009-04-01 05:14:04 +0900 | 1 line Issue #5387: Fixed mmap.move crash by integer overflow. (take2) ........
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index c6c8a30..b9c46cd 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -628,7 +628,7 @@ mmap_move_method(mmap_object *self, PyObject *args)
} else {
/* bounds check the values */
unsigned long pos = src > dest ? src : dest;
- if (self->size >= pos && count > self->size - pos) {
+ if (self->size < pos || count > self->size - pos) {
PyErr_SetString(PyExc_ValueError,
"source or destination out of range");
return NULL;