commit | e239d23e8cc66605f548585ad4489a8f12fc070d | [log] [tgz] |
---|---|---|
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | Wed Dec 08 23:31:48 2010 +0000 |
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | Wed Dec 08 23:31:48 2010 +0000 |
tree | e165422c11006a4f3595742dd40a7a2095ef59ce | |
parent | 1b2bd3b348d7bb861ae8c92853e5058766ebff80 [diff] [blame] |
Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for NULL
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 @@ assert(PyUnicode_Check(Zreplacement)); ptoappend = _PyUnicode_AsStringAndSize(Zreplacement, &ntoappend); - ntoappend = Py_SIZE(Zreplacement); + if (ptoappend == NULL) + goto Done; } else if (ch == 'f') { /* format microseconds */