From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10714 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Sabogal 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 22:40:52 -0500 Message-ID: References: <20161103022936.13564-1-dsabogalcc@gmail.com> <20161107170948.GF1555@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1478576494 21628 195.159.176.226 (8 Nov 2016 03:41:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 Nov 2016 03:41:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10727-gllmg-musl=m.gmane.org@lists.openwall.com Tue Nov 08 04:41:29 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 1c3xHU-0002TG-V9 for gllmg-musl@m.gmane.org; Tue, 08 Nov 2016 04:41:05 +0100 Original-Received: (qmail 27768 invoked by uid 550); 8 Nov 2016 03:41:06 -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 27750 invoked from network); 8 Nov 2016 03:41:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=S6u3Dnsyo2bDmba+xvktLxY3FnMF1zMfjaSy9kEp0gA=; b=ChrAns2ysyZ5Ff4y3kRef0Z6odtxbD8eAYLHOlJ0+inzVy2RemGhrjv0zie/8NnidN +kimt9mTRbjGY/4ndq9r3aloHZ1d9psv5PEiBV4DCtkNrnJcSIrIO8GmquvdCHhfaoaa MJWh2vaccuT0HgixELapOKA13sKcs9cYtRHA6xDRI8QXIxblZSGFglm0X5hJurF/fe0j ynykm17VPnD9K7vDlYQYbOPH7ZgV4Qtwg2ziDVMEhe9+ipe0qYnggB7JaS65HEjofm/Z GSFpsphTtzFh9+pksrsvFIzRI02msekk2wq9NwF0f7LAtLXnXiYGNdv38NrXdi6TAwhB cX/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=S6u3Dnsyo2bDmba+xvktLxY3FnMF1zMfjaSy9kEp0gA=; b=l+rvQuIFf8RuDbzQdJaRZ/mip7WvKTfS+PaO0f8sz/cTHZ4EyiZRLK/LTEj3oSj73M tB1qNCAMi2Cn7/e3KaUkRLgs3u/YCtaMEj4zGUfjrMcOH2UrphqxFMuJ1uTr6GjVoy7M HuoBIHlYiyoNAT3gXc975J0Efpboue2NoOqcs/oYAz0qfZqRqqTixxCc6AceXXChtE2Z TEkFlLeWYVMzl6UVSw69ZJcb32xddiXj3m1fIA0Ifd4wljFsbVWP0CCN9bQ2C4mmtDLR T0SgAfru/S4PJ6WzGLoYpWf9eQMpuZ0K7fMo1tNn+EF5fq9xmcNj1T698nutQHruHxB6 IQlA== X-Gm-Message-State: ABUngveVfkrYfKBJh1/Zv2tOJwQGnmyv/8og2UJcr4hB0HnLYS8mT8snPZQEs1EdgB0fmhV7G9CkpRW5r9y4Bw== X-Received: by 10.157.43.130 with SMTP id u2mr4655042ota.163.1478576453423; Mon, 07 Nov 2016 19:40:53 -0800 (PST) In-Reply-To: <20161107170948.GF1555@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:10714 Archived-At: On Mon, Nov 7, 2016 at 12:09 PM, Rich Felker wrote: > 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 provided a sample program within the patch. Did you have something else in mind for test cases? > 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. I agree.