summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-26 23:56:33 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-26 23:56:33 (GMT)
commit065836ec9c76ed7134562438f5a760a5e20b27e4 (patch)
tree2df759ee75082c9e2d915cb76f4f72ec155cdb97 /Objects
parent7592d0513e7fcc196a0469d0d50384eb4b8836aa (diff)
downloadcpython-065836ec9c76ed7134562438f5a760a5e20b27e4.zip
cpython-065836ec9c76ed7134562438f5a760a5e20b27e4.tar.gz
cpython-065836ec9c76ed7134562438f5a760a5e20b27e4.tar.bz2
PyUnicode_FSDecoder() ensures that the decoded string is ready
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index ec4aed6..ef2839a 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");