mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
Fix PyUnicode_Join() for len==1 and non-exact string
This commit is contained in:
parent
b066cc6aba
commit
c6f0df7b20
1 changed files with 2 additions and 2 deletions
|
@ -9154,6 +9154,7 @@ PyUnicode_Join(PyObject *separator, PyObject *seq)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
sep = NULL;
|
sep = NULL;
|
||||||
|
maxchar = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Set up sep and seplen */
|
/* Set up sep and seplen */
|
||||||
|
@ -9203,8 +9204,7 @@ PyUnicode_Join(PyObject *separator, PyObject *seq)
|
||||||
goto onError;
|
goto onError;
|
||||||
sz += PyUnicode_GET_LENGTH(item);
|
sz += PyUnicode_GET_LENGTH(item);
|
||||||
item_maxchar = PyUnicode_MAX_CHAR_VALUE(item);
|
item_maxchar = PyUnicode_MAX_CHAR_VALUE(item);
|
||||||
if (item_maxchar > maxchar)
|
maxchar = Py_MAX(maxchar, item_maxchar);
|
||||||
maxchar = item_maxchar;
|
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
sz += seplen;
|
sz += seplen;
|
||||||
if (sz < old_sz || sz > PY_SSIZE_T_MAX) {
|
if (sz < old_sz || sz > PY_SSIZE_T_MAX) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue