summaryrefslogtreecommitdiffstats
path: root/Modules/_datetimemodule.c
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-12-08 23:31:48 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-12-08 23:31:48 (GMT)
commite239d23e8cc66605f548585ad4489a8f12fc070d (patch)
treee165422c11006a4f3595742dd40a7a2095ef59ce /Modules/_datetimemodule.c
parent1b2bd3b348d7bb861ae8c92853e5058766ebff80 (diff)
downloadcpython-e239d23e8cc66605f548585ad4489a8f12fc070d.zip
cpython-e239d23e8cc66605f548585ad4489a8f12fc070d.tar.gz
cpython-e239d23e8cc66605f548585ad4489a8f12fc070d.tar.bz2
Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for NULL
Diffstat (limited to 'Modules/_datetimemodule.c')
-rw-r--r--Modules/_datetimemodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 32fe835..16964d8 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -1257,7 +1257,8 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
assert(PyUnicode_Check(Zreplacement));
ptoappend = _PyUnicode_AsStringAndSize(Zreplacement,
&ntoappend);
- ntoappend = Py_SIZE(Zreplacement);
+ if (ptoappend == NULL)
+ goto Done;
}
else if (ch == 'f') {
/* format microseconds */