Message99540
I wonder: with year bounds being checked in gettmarg() and mktime accepting arbitrary values for the rest of the tm structure members (at least it appears to on my Mac), is it possible trigger "mktime argument out of range"?
If it is possible, then a unit test should be added for such case. Note that the issue2736 patch contains a typo that assures that overflow is never reported, but the unit test presented here does not catch that bug:
"""
+ buf.tm_wday = -1;
tt = mktime(&buf);
- if (tt == (time_t)(-1)) {
+ if (tt == (time_t)(-1) && buf.tm_wday == 1) {
PyErr_SetString(PyExc_OverflowError,
"mktime argument out of range");
"""
(Note missing '-' in buf.tm_wday == 1 check. See issue2736.) |
|
Date |
User |
Action |
Args |
2010-02-18 22:28:56 | Alexander.Belopolsky | set | recipients:
+ Alexander.Belopolsky, loewis, amaury.forgeotdarc, blais, vstinner |
2010-02-18 22:28:56 | Alexander.Belopolsky | set | messageid: <1266532136.71.0.968702228362.issue1726687@psf.upfronthosting.co.za> |
2010-02-18 22:28:55 | Alexander.Belopolsky | link | issue1726687 messages |
2010-02-18 22:28:55 | Alexander.Belopolsky | create | |
|