diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytesobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index d6cce6d..3127c9d 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -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; |