From owner-svn-src-stable-9@FreeBSD.ORG Wed Mar 27 07:58:29 2013 Return-Path: Delivered-To: svn-src-stable-9@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 9E009688; Wed, 27 Mar 2013 07:58:29 +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 90439AF4; Wed, 27 Mar 2013 07:58:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2R7wTe3011493; Wed, 27 Mar 2013 07:58:29 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2R7wT8Y011492; Wed, 27 Mar 2013 07:58:29 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201303270758.r2R7wT8Y011492@svn.freebsd.org> From: Dimitry Andric Date: Wed, 27 Mar 2013 07:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248787 - stable/9/lib/libc/stdtime X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Mar 2013 07:58:29 -0000 Author: dim Date: Wed Mar 27 07:58:29 2013 New Revision: 248787 URL: http://svnweb.freebsd.org/changeset/base/248787 Log: MFC r248672: 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. Modified: stable/9/lib/libc/stdtime/Makefile.inc Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdtime/Makefile.inc ============================================================================== --- stable/9/lib/libc/stdtime/Makefile.inc Wed Mar 27 07:30:08 2013 (r248786) +++ stable/9/lib/libc/stdtime/Makefile.inc Wed Mar 27 07:58:29 2013 (r248787) @@ -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