mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
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:
parent
6bf6367b67
commit
16caab00a2
3 changed files with 21 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue