mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Issue #5387: Fixed mmap.move crash by integer overflow. (take2)
This commit is contained in:
parent
65ff00559a
commit
1d7d5325be
2 changed files with 17 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue