diff options
| author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-01-02 23:09:41 +0000 |
|---|---|---|
| committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-01-02 23:09:41 +0000 |
| commit | d4bf48bbb3d8aa63e48abafff44928468f593221 (patch) | |
| tree | 9b0fed58e3fae4f22dc6f32ab28ded6fb60e5207 /Modules | |
| parent | ed3baf35c3159381afccf81af4f1e58abb634adb (diff) | |
| download | cpython-git-d4bf48bbb3d8aa63e48abafff44928468f593221.tar.gz | |
Merged revisions 87648,87656 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r87648 | alexander.belopolsky | 2011-01-02 15:48:22 -0500 (Sun, 02 Jan 2011) | 1 line
Issue #8013: Fixed time.asctime segfault when OS's asctime fails
........
r87656 | alexander.belopolsky | 2011-01-02 17:16:10 -0500 (Sun, 02 Jan 2011) | 1 line
Issue #8013: Fixed test
........
Diffstat (limited to 'Modules')
| -rw-r--r-- | Modules/timemodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index abc43a2615..32bdaf7ad2 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -643,6 +643,10 @@ time_asctime(PyObject *self, PyObject *args) } else if (!gettmarg(tup, &buf)) return NULL; p = asctime(&buf); + if (p == NULL) { + PyErr_SetString(PyExc_ValueError, "invalid time"); + return NULL; + } if (p[24] == '\n') p[24] = '\0'; return PyUnicode_FromString(p); |
