Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cda4f9a

Browse files
committed
Fix off-by-one error in split_substring(). Fixes SF bug #122162.
1 parent 8b26454 commit cda4f9a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2925,7 +2925,7 @@ PyObject *split_substring(PyUnicodeObject *self,
29252925
int sublen = substring->length;
29262926
PyObject *str;
29272927

2928-
for (i = j = 0; i < len - sublen; ) {
2928+
for (i = j = 0; i <= len - sublen; ) {
29292929
if (Py_UNICODE_MATCH(self, i, substring)) {
29302930
if (maxcount-- <= 0)
29312931
break;

0 commit comments

Comments
 (0)