diff options
author | Tim Golden <mail@timgolden.me.uk> | 2013-11-12 12:48:20 (GMT) |
---|---|---|
committer | Tim Golden <mail@timgolden.me.uk> | 2013-11-12 12:48:20 (GMT) |
commit | bbe268f58334ec87940094f18dd2e13d1ef2ca70 (patch) | |
tree | df1f0106b936677abb086dd69f7fb52c9000df77 /Modules | |
parent | dfcd69467489b940232adb5c82dd91aab4a25406 (diff) | |
parent | 6e51b8ff0f1a2210548b3ce18e6ba840e0a3c8ae (diff) | |
download | cpython-bbe268f58334ec87940094f18dd2e13d1ef2ca70.zip cpython-bbe268f58334ec87940094f18dd2e13d1ef2ca70.tar.gz cpython-bbe268f58334ec87940094f18dd2e13d1ef2ca70.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 8d161d4..2e48007 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -642,6 +642,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 |