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

Georg Brandl report at bugs.python.org
Sun Jan 2 15:37:45 CET 2011


Georg Brandl <georg at python.org> added the comment:

The patch is wrong: it hardcodes the number of characters that the time string has, but it can be more than 24 if the year is > 9999.  (Of course, the check for \n currently in the code is wrong too and must be fixed.)

Also, shouldn't the issue be handled as in ctime()?  There is a NULL check there, and by just doing that check we wouldn't depend on asctime_r().

----------
assignee:  -> belopolsky
nosy: +belopolsky, georg.brandl

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


More information about the Python-bugs-list mailing list