From 4fc8ae424f915d07ff56d32dceec3d2c4a89560e Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 27 Feb 2007 20:57:45 +0000 Subject: Fix off-by-one bug in memmove() call in bytes_insert(). Fix by Pete Shinners (for his own bug :-). --- Objects/bytesobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index f7de8bd..f07130d 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2313,7 +2313,7 @@ bytes_insert(PyBytesObject *self, PyObject *args) } if (where > n) where = n; - memmove(self->ob_bytes + where + 1, self->ob_bytes + where, n - where + 1); + memmove(self->ob_bytes + where + 1, self->ob_bytes + where, n - where); self->ob_bytes[where] = value; Py_RETURN_NONE; -- cgit v0.12