Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150920195450.GD10551@port70.net>
Date: Sun, 20 Sep 2015 21:54:50 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: out of range struct tm fields in strftime

* Szabolcs Nagy <nsz@...t70.net> [2015-09-20 18:44:35 +0200]:
> * Rich Felker <dalias@...c.org> [2015-09-20 12:36:29 -0400]:
> > On Sun, Sep 20, 2015 at 02:44:50PM +0200, Szabolcs Nagy wrote:
> > > out of range tm fields should not be treated as ub
> > > as noted in the thread
> > > http://sourceware.org/ml/libc-alpha/2015-09/msg00546.html
> > > 
> > > i have a patch but there might be simpler approaches
> > 
> > Wouldn't it be less invasive to just make some small changes like
> > putting a U on some of the constants so that the arithmetic happens as
> > unsigned?
> > 
> 
> that might be simpler (and probably generates better
> code for div,mod by const)
> 
> but for the nl_langinfo item computation the range
> has to be limited properly (tm_wday and tm_mon are
> affected).

implemented this approach with wday%7U and using some 0U+

View attachment "0001-fix-strftime-to-handle-out-of-range-tm-fields-withou.patch" of type "text/x-diff" (3060 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.