From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11494 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Handle localtime errors in ctime Date: Thu, 15 Jun 2017 13:26:18 -0400 Message-ID: <20170615172618.GR1627@brightrain.aerifal.cx> References: <1497545016-22965-1-git-send-email-oaanson@gmail.com> <20170615165413.GO1627@brightrain.aerifal.cx> <20170615170642.GQ1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1497547596 7517 195.159.176.226 (15 Jun 2017 17:26:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Jun 2017 17:26:36 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11507-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jun 15 19:26:32 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dLYXL-0001Vp-Q9 for gllmg-musl@m.gmane.org; Thu, 15 Jun 2017 19:26:27 +0200 Original-Received: (qmail 29758 invoked by uid 550); 15 Jun 2017 17:26:31 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 29735 invoked from network); 15 Jun 2017 17:26:30 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11494 Archived-At: On Thu, Jun 15, 2017 at 08:19:29PM +0300, Alexander Monakov wrote: > On Thu, 15 Jun 2017, Rich Felker wrote: > > > Um, the previous time an opposite direction was taken: > > > http://www.openwall.com/lists/musl/2014/09/05/17 > > > > I found this in POSIX while reviewing the new patch: > > > > [CX] [Option Start] Upon successful completion, ctime_r() shall return > > a pointer to the string pointed to by buf. When an error is > > encountered, a null pointer shall be returned. [Option End] > > > > So while ISO C may not have anything to say about it (i.e. it's UB in > > plain C), POSIX does seem to require handling the error. I forgot we'd > > looked at this before but it seems we missed what POSIX had to say. > > .... even though the quoted POSIX spec specifically mentions ctime_r, not ctime? > (musl implementation of ctime_r does appear to miss that, though) Doh, I misread. Sorry. I'll go fix that now... Rich