Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: segfault in strftime



On 2010-02-26 13:03:28 +0000, Peter Stephenson wrote:
> I don't see where that would cause a problem, so I'd be interested in a
> backtrace---the only place I can see it going wrong is within strtoul().

zsh doesn't check for localtime() failure in datetime.c:

    t = localtime(&secs);
    bufsize = strlen(argv[0]) * 8;
    buffer = zalloc(bufsize);

    for (x=0; x < 4; x++) {
        if (ztrftime(buffer, bufsize, argv[0], t) >= 0)
            break;
        buffer = zrealloc(buffer, bufsize *= 2);
    }

t may be null.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author