Commit 020d71a6 authored by Victor Stinner's avatar Victor Stinner

Fix unicode_adjust_maxchar(): catch PyUnicode_New() failure

parent 58af68be
...@@ -2084,7 +2084,8 @@ unicode_adjust_maxchar(PyObject **p_unicode) ...@@ -2084,7 +2084,8 @@ unicode_adjust_maxchar(PyObject **p_unicode)
return; return;
} }
copy = PyUnicode_New(len, max_char); copy = PyUnicode_New(len, max_char);
_PyUnicode_FastCopyCharacters(copy, 0, unicode, 0, len); if (copy != NULL)
_PyUnicode_FastCopyCharacters(copy, 0, unicode, 0, len);
Py_DECREF(unicode); Py_DECREF(unicode);
*p_unicode = copy; *p_unicode = copy;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment