diff options
author | Thomas Wouters <thomas@python.org> | 2006-08-23 23:20:29 +0000 |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-08-23 23:20:29 +0000 |
commit | 9a6e62b947ebb5547ca9a164f6145a461b98d86a (patch) | |
tree | d566337c0211e6a515a987d0d682635885973f83 /Objects/bytesobject.c | |
parent | fbfe0936078e16829f36a6e61b511c123fd17b17 (diff) | |
download | cpython-git-9a6e62b947ebb5547ca9a164f6145a461b98d86a.tar.gz |
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)
Diffstat (limited to 'Objects/bytesobject.c')
-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 d6cce6d49e..3127c9d169 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; |