diff Modules/mmapmodule.c @ 52578:d9c8d1a5ddee 2.6

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) ........
author Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
date Tue, 31 Mar 2009 20:22:13 +0000
parents 6ddbdfdb7a86
children 3c8f4f7e4a62
line wrap: on
line diff
--- a/Modules/mmapmodule.c	Tue Mar 31 18:39:39 2009 +0000
+++ b/Modules/mmapmodule.c	Tue Mar 31 20:22:13 2009 +0000
@@ -617,7 +617,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;