Date: Wed, 4 Dec 2002 20:14:05 -0800 (PST) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 21952 for review Message-ID: <200212050414.gB54E5ur050347@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=21952 Change 21952 by peter@peter_itanic2 on 2002/12/04 20:13:29 OK, I'm going to shoot myself. We do need an upper limit on time_t that we send in here or we cannot represent it in the internal struct tm for comparisons. This does need to be fixed better. Affected files ... .. //depot/projects/ia64/lib/libc/stdtime/localtime.c#10 edit Differences ... ==== //depot/projects/ia64/lib/libc/stdtime/localtime.c#10 (text+ko) ==== @@ -1476,6 +1476,11 @@ */ bits = TYPE_BIT(time_t) - 1; /* + ** If we have more than this, we will overflow tm_year in tmcomp(). + */ + if (bits > 56) + bits = 56; + /* ** If time_t is signed, then 0 is just above the median, ** assuming two's complement arithmetic. ** If time_t is unsigned, then (1 << bits) is just above the median. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212050414.gB54E5ur050347>