diff options
| author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-12-08 23:31:48 +0000 |
|---|---|---|
| committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-12-08 23:31:48 +0000 |
| commit | e239d23e8cc66605f548585ad4489a8f12fc070d (patch) | |
| tree | e165422c11006a4f3595742dd40a7a2095ef59ce /Modules/_datetimemodule.c | |
| parent | 1b2bd3b348d7bb861ae8c92853e5058766ebff80 (diff) | |
| download | cpython-git-e239d23e8cc66605f548585ad4489a8f12fc070d.tar.gz | |
Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for NULL
Diffstat (limited to 'Modules/_datetimemodule.c')
| -rw-r--r-- | Modules/_datetimemodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 32fe835a02..16964d8dbe 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 */ |
