mirror of https://github.com/python/cpython
Fix off-by-one error in split_substring(). Fixes SF bug #122162.
This commit is contained in:
parent
8b26454273
commit
cda4f9a8dc
|
@ -2925,7 +2925,7 @@ PyObject *split_substring(PyUnicodeObject *self,
|
|||
int sublen = substring->length;
|
||||
PyObject *str;
|
||||
|
||||
for (i = j = 0; i < len - sublen; ) {
|
||||
for (i = j = 0; i <= len - sublen; ) {
|
||||
if (Py_UNICODE_MATCH(self, i, substring)) {
|
||||
if (maxcount-- <= 0)
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue