Merged revisions 70800 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70800 | hirokazu.yamamoto | 2009-03-31 22:13:05 +0900 | 1 line

  Issue #5387: Fixed mmap.move crash by integer overflow.
........
This commit is contained in:
Hirokazu Yamamoto 2009-03-31 13:44:06 +00:00
parent 6bf6367b67
commit 16caab00a2
3 changed files with 21 additions and 4 deletions

View file

@ -623,10 +623,8 @@ mmap_move_method(mmap_object *self, PyObject *args)
return NULL;
} else {
/* bounds check the values */
if (/* end of source after end of data?? */
((src+count) > self->size)
/* dest will fit? */
|| (dest+count > self->size)) {
unsigned long pos = src > dest ? src : dest;
if (self->size >= pos && count > self->size - pos) {
PyErr_SetString(PyExc_ValueError,
"source or destination out of range");
return NULL;