diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-06-16 01:17:34 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-06-16 01:17:34 (GMT) |
commit | ca439eecea1f293d6954cc5cb562199480b74c17 (patch) | |
tree | d6f3cbb6e87efcbb34f7f48e98243be414cc2cd3 | |
parent | 184252ad3f66fe829aca03386d9ade38ce5aa4c4 (diff) | |
download | cpython-ca439eecea1f293d6954cc5cb562199480b74c17.zip cpython-ca439eecea1f293d6954cc5cb562199480b74c17.tar.gz cpython-ca439eecea1f293d6954cc5cb562199480b74c17.tar.bz2 |
Fix unicode_adjust_maxchar(): catch PyUnicode_New() failure
-rw-r--r-- | Objects/unicodeobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index d1f2a35..ad0e2e3 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -2084,7 +2084,8 @@ unicode_adjust_maxchar(PyObject **p_unicode) return; } 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); *p_unicode = copy; } |