From owner-svn-src-head@FreeBSD.ORG Sun Mar 24 01:35:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F24B5C36; Sun, 24 Mar 2013 01:35:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3A925F3; Sun, 24 Mar 2013 01:35:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2O1Zbxw065965; Sun, 24 Mar 2013 01:35:37 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2O1Zb95065964; Sun, 24 Mar 2013 01:35:37 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201303240135.r2O1Zb95065964@svn.freebsd.org> From: Dimitry Andric Date: Sun, 24 Mar 2013 01:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248672 - head/lib/libc/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Mar 2013 01:35:38 -0000 Author: dim Date: Sun Mar 24 01:35:37 2013 New Revision: 248672 URL: http://svnweb.freebsd.org/changeset/base/248672 Log: Compile contrib/tzcode/stdtime/localtime.c with -fwrapv, since it relies on signed integer overflow wrapping. Otherwise mktime(3) and timegm(3) can hang, in case the timestamp passed in struct tm is not representable in a time_t. Specifically, any timestamp after 2038-01-19 03:14:07, in combination with a 32-bit time_t. Note that it would be better to change the code to not rely on undefined behaviour, but it is contributed code, and it is not entirely trivial to fix the issue properly. MFC after: 3 days Modified: head/lib/libc/stdtime/Makefile.inc Modified: head/lib/libc/stdtime/Makefile.inc ============================================================================== --- head/lib/libc/stdtime/Makefile.inc Sun Mar 24 00:03:12 2013 (r248671) +++ head/lib/libc/stdtime/Makefile.inc Sun Mar 24 01:35:37 2013 (r248672) @@ -11,6 +11,9 @@ SYM_MAPS+= ${.CURDIR}/stdtime/Symbol.map CFLAGS+= -I${.CURDIR}/../../contrib/tzcode/stdtime -I${.CURDIR}/stdtime +CFLAGS.localtime.c= -fwrapv +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} + MAN+= ctime.3 strftime.3 strptime.3 time2posix.3 MAN+= tzfile.5