summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-02 23:26:12 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-02 23:26:12 (GMT)
commit41769a7513dd47bf00d88e8ccb32aa3cacef0415 (patch)
treee26a699b547c62cf1b22cafdb55f78095f2aec81 /Modules
parent893c354a556fa3731644d6698d47c1112bd4b45a (diff)
downloadcpython-41769a7513dd47bf00d88e8ccb32aa3cacef0415.zip
cpython-41769a7513dd47bf00d88e8ccb32aa3cacef0415.tar.gz
cpython-41769a7513dd47bf00d88e8ccb32aa3cacef0415.tar.bz2
Merged revisions 87663 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r87663 | alexander.belopolsky | 2011-01-02 18:23:54 -0500 (Sun, 02 Jan 2011) | 13 lines 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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index d6d4160..a59d3f0 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -546,6 +546,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 PyString_FromString(p);