From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10713 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH v2] fix integer overflow of tm_year in __secs_to_tm Date: Mon, 7 Nov 2016 12:09:48 -0500 Message-ID: <20161107170948.GF1555@brightrain.aerifal.cx> References: <20161103022936.13564-1-dsabogalcc@gmail.com> 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 1478538635 6319 195.159.176.226 (7 Nov 2016 17:10:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2016 17:10:35 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10726-gllmg-musl=m.gmane.org@lists.openwall.com Mon Nov 07 18:10:30 2016 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 1c3nQl-00063N-T4 for gllmg-musl@m.gmane.org; Mon, 07 Nov 2016 18:10:00 +0100 Original-Received: (qmail 31865 invoked by uid 550); 7 Nov 2016 17:10:01 -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 31847 invoked from network); 7 Nov 2016 17:10:00 -0000 Content-Disposition: inline In-Reply-To: <20161103022936.13564-1-dsabogalcc@gmail.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10713 Archived-At: On Wed, Nov 02, 2016 at 10:29:36PM -0400, Daniel Sabogal wrote: > From: Daniel Sabogal > > the overflow check for years+100 did not account for the extra > year computed from the remaining months. instead, perform this > check after obtaining the final number of years. > --- > v2: Subtract 12 from months, not 10. Thanks. I almost accepted the old patch with the error. Maybe in the future consider including a test case with the patch. I don't want to make testcases a prerequisite for bug fixes because that leads to bugs going unfixed for a long time, but perhaps for obscure issues like this unlikely to be hit in real-world use, it would be good to strongly encourage submission of test cases with patches. Rich