diff options
author | Tim Golden <mail@timgolden.me.uk> | 2013-11-12 12:36:54 (GMT) |
---|---|---|
committer | Tim Golden <mail@timgolden.me.uk> | 2013-11-12 12:36:54 (GMT) |
commit | 6e51b8ff0f1a2210548b3ce18e6ba840e0a3c8ae (patch) | |
tree | c3614c7ce4a2dafe20a429928f151adc341edafa /Modules | |
parent | c12f09ed24db31f0fc0b58010cb3da9e3107e06c (diff) | |
download | cpython-6e51b8ff0f1a2210548b3ce18e6ba840e0a3c8ae.zip cpython-6e51b8ff0f1a2210548b3ce18e6ba840e0a3c8ae.tar.gz cpython-6e51b8ff0f1a2210548b3ce18e6ba840e0a3c8ae.tar.bz2 |
Issue13674 Correct crash with strftime %y format under Windows
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/timemodule.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 03476d9..42ec366 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -632,6 +632,13 @@ time_strftime(PyObject *self, PyObject *args) Py_DECREF(format); return NULL; } + if ((outbuf[1] == 'y') && buf.tm_year < 0) + { + PyErr_SetString(PyExc_ValueError, + "format %y requires year >= 1900 on Windows"); + Py_DECREF(format); + return NULL; + } } #endif |