Re: [hackers] [sbase] ls: fix segfault when timestamp is negative

From: Connor Lane Smith <cls_AT_lubutu.com>
Date: Sun, 27 Mar 2016 16:30:55 +0100

On 27 March 2016 at 15:06, Mattias Andrée <maandree_AT_kth.se> wrote:
> The problem occur when tv_sec < -67768040609745132L.
> It is not a bug in glibc. What happens is that tm_year
> would overflow and therefore localtime returns NULL.

Right, yeah, that makes more sense.

> I think the best solution would be check whether localtime
> returns NULL.

I agree. That really should be checked in any case, since it can fail.

cls
Received on Sun Mar 27 2016 - 17:30:55 CEST

This archive was generated by hypermail 2.3.0 : Sun Mar 27 2016 - 17:36:15 CEST