Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160724014740.GM15995@brightrain.aerifal.cx>
Date: Sat, 23 Jul 2016 21:47:41 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: strftime sets errno to 22

On Sat, Jul 23, 2016 at 10:17:30PM -0300, Alba Pompeo wrote:
> Hello musl people.
> 
> I was reading some commits messages from a project and ended up seeing
> something that might be interesting to you.
> 
> https://github.com/izabera/inutility/commit/1db3ba948ad1d4cbfa8c0164fa475439c99c06bc
> 
> I don't think it's been reported yet.

Except for a few special functions with more restrictive
specification, you can only expect errno to contain something
meaningful immediately after a function returns with a return value
indicating an error. The code above was assuming that errno being set
indicated an error even when strftime succeeded.

With that said, at the time this was reported on IRC I looked for the
cause of errno being set to EINVAL and didn't see it. It might be nice
to know why it's happening, just in case some unintended code paths
with nontrivial cost are getting pulled in.

Rich

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.