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

From: Mattias Andrée <maandree_AT_kth.se>
Date: Sun, 27 Mar 2016 15:20:18 +0200

On Sun, 27 Mar 2016 15:12:57 +0200
Quentin Rameau <quinq_AT_fifth.space> wrote:

> Hi Mattias,
>
> > + if (ent->t.tv_sec < 0)
> Can it be?
> Could you provide me with a reproducible case?
> Thanks.
>

I have submitted a patch to ubase that adds
shred(1). I used unlink(3) instead of remove(3)
first which caused the directory's name, atime
and mtime to be shredded but the directory was
never removed. The timestamp happened to be negative
which caused strftime (glibc) in ls to segfault.
Of course, this should probably be addressed in
strftime since negative times are valid; they
just unlikely to be true on files.

Received on Sun Mar 27 2016 - 15:20:18 CEST

This archive was generated by hypermail 2.3.0 : Sun Mar 27 2016 - 15:24:20 CEST