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)
........
This commit is contained in:
Hirokazu Yamamoto 2009-03-31 20:43:56 +00:00
parent 33413cbf5e
commit 2ca15013ec
2 changed files with 17 additions and 5 deletions

View file

@ -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;