diff Objects/unicodeobject.c @ 73140:e7340f2a42eb

PyUnicode_FSDecoder() ensures that the decoded string is ready
author Victor Stinner <victor.stinner@haypocalc.com>
date Thu, 27 Oct 2011 01:56:33 +0200
parents 84a70229c05e
children 085d3a2d4102
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Thu Oct 27 01:43:48 2011 +0200
+++ b/Objects/unicodeobject.c	Thu Oct 27 01:56:33 2011 +0200
@@ -3318,6 +3318,10 @@
             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");