Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 20 Jul 2013 03:11:06 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: time code progress

* Rich Felker <dalias@...ifal.cx> [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<LONG_MIN) goto error;

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.