mirror of https://github.com/python/cpython
Fix off-by-one bug in memmove() call in bytes_insert().
Fix by Pete Shinners (for his own bug :-).
This commit is contained in:
parent
6f8fe151da
commit
4fc8ae424f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue