Index: Lib/test/test_mmap.py =================================================================== --- Lib/test/test_mmap.py (revision 70800) +++ Lib/test/test_mmap.py (working copy) @@ -354,6 +354,7 @@ # should not crash m = mmap.mmap(-1, 1) self.assertRaises(ValueError, m.move, 1, 1, -1) + self.assertRaises(ValueError, m.move, -1, -1, 1) m.close() def test_anonymous(self): Index: Modules/mmapmodule.c =================================================================== --- Modules/mmapmodule.c (revision 70800) +++ Modules/mmapmodule.c (working copy) @@ -613,7 +613,7 @@ } 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;