[issue8013] time.asctime segfaults when given a time in the far future

Alexander Belopolsky report at bugs.python.org
Mon Jan 3 01:02:27 CET 2011


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

Backported in r87664 (2.6), r87663 (2.7) and r87662 (3.1).

Reopening to implement bounds checking for 3.2.  Note that for time.asctime, checking the year range is trivial, but for time.ctime it is not because year is not computed in python code.  One solution may be to check bounds of the time_t timestamp, but those depend on the timezone.  Maybe it is easiest to simply call mktime(), check year and call asctime() bypassing OS ctime completely.

----------
components: +Extension Modules -Library (Lib)
nosy:  -Alexander.Belopolsky
resolution: fixed -> 
stage: patch review -> needs patch
status: closed -> open
type: crash -> behavior
versions:  -Python 2.7, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8013>
_______________________________________


More information about the Python-bugs-list mailing list