From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3694 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: time code progress Date: Sat, 20 Jul 2013 03:11:06 +0200 Message-ID: <20130720011106.GC15323@port70.net> References: <20130716194553.GA9438@brightrain.aerifal.cx> <20130717093325.GA12469@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1374282678 16982 80.91.229.3 (20 Jul 2013 01:11:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Jul 2013 01:11:18 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3698-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jul 20 03:11:19 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1V0Lhe-0002Xb-GW for gllmg-musl@plane.gmane.org; Sat, 20 Jul 2013 03:11:18 +0200 Original-Received: (qmail 3763 invoked by uid 550); 20 Jul 2013 01:11:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3755 invoked from network); 20 Jul 2013 01:11:17 -0000 Content-Disposition: inline In-Reply-To: <20130717093325.GA12469@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3694 Archived-At: * Rich Felker [2013-07-17 05:33:25 -0400]: > Committed. Please let me know what bugs you find. :-) in mktime the overflow check is not strictly ok, time_t is signed so the check relies on signed overflow long long t = __tm_to_secs(tm); // ... if ((time_t)t != t) goto error; i'm not sure how to do the check efficiently without invoking ub, but at least this should be commented time_t seem to be long on all supported platforms so this should work: if (t>LONG_MAX || t