From: Guido van Rossum Date: Tue, 27 Feb 2007 20:57:45 +0000 (+0000) Subject: Fix off-by-one bug in memmove() call in bytes_insert(). X-Git-Tag: v3.0a1~1139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fc8ae424f915d07ff56d32dceec3d2c4a89560e;p=python Fix off-by-one bug in memmove() call in bytes_insert(). Fix by Pete Shinners (for his own bug :-). --- diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index f7de8bdd86..f07130d809 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;