mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix buglet in slice assignment of bytesobjects: assigning to b[3:0] ('stop'
being before 'start') would actually assign to b[0:0] (or whatever 'stop' was)
This commit is contained in:
parent
fbfe093607
commit
9a6e62b947
2 changed files with 5 additions and 0 deletions
|
@ -310,6 +310,8 @@ bytes_setslice(PyBytesObject *self, Py_ssize_t lo, Py_ssize_t hi,
|
|||
|
||||
if (lo < 0)
|
||||
lo = 0;
|
||||
if (hi < lo)
|
||||
hi = lo;
|
||||
if (hi > self->ob_size)
|
||||
hi = self->ob_size;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue