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

Alexander Belopolsky report at bugs.python.org
Sun Jan 2 19:52:36 CET 2011


Alexander Belopolsky <alexander.belopolsky at gmail.com> added the comment:

On Sun, Jan 2, 2011 at 10:52 AM, Georg Brandl <report at bugs.python.org> wrote:
..
> Well, then I would have no problem with checking for that condition beforehand and raising
> ValueError.
>

IIRC, there was a similar bug report about ctime where pre-condition
checking was required because platform ctime would crash for huge
values of time.  I'll try to find the ticket.

> On the other hand, it seems that implementations either return a correct string or NULL,
> so just erroring out in case of NULL would be fine as well.

This is true on the platforms that I have access to: OSX, Linux, and
Solaris.  I think asctime_r is available and behaves this way on
Python supported platforms.  I'll check this in and watch the bots.

----------

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


More information about the Python-bugs-list mailing list