homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Alexander.Belopolsky
Recipients Alexander.Belopolsky, amaury.forgeotdarc, blais, loewis, vstinner
Date 2010年02月18日.22:28:54
SpamBayes Score 4.046043e-09
Marked as misclassified No
Message-id <1266532136.71.0.968702228362.issue1726687@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2010年02月18日 22:28:56Alexander.Belopolskysetrecipients: + Alexander.Belopolsky, loewis, amaury.forgeotdarc, blais, vstinner
2010年02月18日 22:28:56Alexander.Belopolskysetmessageid: <1266532136.71.0.968702228362.issue1726687@psf.upfronthosting.co.za>
2010年02月18日 22:28:55Alexander.Belopolskylinkissue1726687 messages
2010年02月18日 22:28:55Alexander.Belopolskycreate

AltStyle によって変換されたページ (->オリジナル) /