diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2009-03-31 20:14:04 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2009-03-31 20:14:04 (GMT) |
commit | 1d7d5325be5c766c3446dcf0fce4ebce73d83fa7 (patch) | |
tree | 60b65d642fc02ece812c0f6c069d259a19014c64 /Modules | |
parent | 65ff00559a1192bccb23b5af9abb54db361d9124 (diff) | |
download | cpython-1d7d5325be5c766c3446dcf0fce4ebce73d83fa7.zip cpython-1d7d5325be5c766c3446dcf0fce4ebce73d83fa7.tar.gz cpython-1d7d5325be5c766c3446dcf0fce4ebce73d83fa7.tar.bz2 |
Issue #5387: Fixed mmap.move crash by integer overflow. (take2)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/mmapmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index bd7f7cc..cbacc2f 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -617,7 +617,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; |