From: Victor Stinner Date: Wed, 26 Oct 2011 23:56:33 +0000 (+0200) Subject: PyUnicode_FSDecoder() ensures that the decoded string is ready X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=065836ec9c76ed7134562438f5a760a5e20b27e4;p=python PyUnicode_FSDecoder() ensures that the decoded string is ready --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index ec4aed6e2d..ef2839a125 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3318,6 +3318,10 @@ PyUnicode_FSDecoder(PyObject* arg, void* addr) return 0; } } + if (PyUnicode_READY(output) < 0) { + Py_DECREF(output); + return 0; + } if (findchar(PyUnicode_DATA(output), PyUnicode_KIND(output), PyUnicode_GET_LENGTH(output), 0, 1) >= 0) { PyErr_SetString(PyExc_TypeError, "embedded NUL character");