From owner-svn-src-vendor@FreeBSD.ORG Wed Feb 17 11:18:25 2010 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CDA01065711; Wed, 17 Feb 2010 11:18:25 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B4728FC0C; Wed, 17 Feb 2010 11:18:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1HBIPFu026721; Wed, 17 Feb 2010 11:18:25 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1HBIPdY026717; Wed, 17 Feb 2010 11:18:25 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002171118.o1HBIPdY026717@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 17 Feb 2010 11:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204001 - in vendor/tzcode/dist: libc/stdtime unused X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 11:18:25 -0000 Author: edwin Date: Wed Feb 17 11:18:24 2010 New Revision: 204001 URL: http://svn.freebsd.org/changeset/base/204001 Log: Vendor import of tzcode2010a: * asctime.c - Set errno to EINVAL and return "??? ??? ?? ??:??:?? ????\n" if asctime_r is called with a NULL struct tm pointer. (Note that asctime_r is called by ctime_r and asctime; asctime is called by ctime.) * localtime.c - Set errno to EINVAL and return WRONG if time1 is called with a NULL struct tm pointer; avoid dereference if a NULL struct tm pointer is passed to timelocal, timegm, or timeoff. (Note that time1 is called by mktime, timegm, and timeoff; mktime is called by timelocal.) Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzcode/dist/libc/stdtime/asctime.c vendor/tzcode/dist/libc/stdtime/localtime.c vendor/tzcode/dist/unused/tz-art.htm Modified: vendor/tzcode/dist/libc/stdtime/asctime.c ============================================================================== --- vendor/tzcode/dist/libc/stdtime/asctime.c Wed Feb 17 10:39:39 2010 (r204000) +++ vendor/tzcode/dist/libc/stdtime/asctime.c Wed Feb 17 11:18:24 2010 (r204001) @@ -11,7 +11,7 @@ #ifndef lint #ifndef NOID -static char elsieid[] = "@(#)asctime.c 8.2"; +static char elsieid[] = "@(#)asctime.c 8.5"; #endif /* !defined NOID */ #endif /* !defined lint */ @@ -91,6 +91,10 @@ char * buf; char year[INT_STRLEN_MAXIMUM(int) + 2]; char result[MAX_ASCTIME_BUF_SIZE]; + if (timeptr == NULL) { + errno = EINVAL; + return strcpy(buf, "??? ??? ?? ??:??:?? ????\n"); + } if (timeptr->tm_wday < 0 || timeptr->tm_wday >= DAYSPERWEEK) wn = "???"; else wn = wday_name[timeptr->tm_wday]; @@ -113,10 +117,9 @@ char * buf; timeptr->tm_mday, timeptr->tm_hour, timeptr->tm_min, timeptr->tm_sec, year); - if (strlen(result) < STD_ASCTIME_BUF_SIZE || buf == buf_asctime) { - (void) strcpy(buf, result); - return buf; - } else { + if (strlen(result) < STD_ASCTIME_BUF_SIZE || buf == buf_asctime) + return strcpy(buf, result); + else { #ifdef EOVERFLOW errno = EOVERFLOW; #else /* !defined EOVERFLOW */ Modified: vendor/tzcode/dist/libc/stdtime/localtime.c ============================================================================== --- vendor/tzcode/dist/libc/stdtime/localtime.c Wed Feb 17 10:39:39 2010 (r204000) +++ vendor/tzcode/dist/libc/stdtime/localtime.c Wed Feb 17 11:18:24 2010 (r204001) @@ -5,7 +5,7 @@ #ifndef lint #ifndef NOID -static char elsieid[] = "@(#)localtime.c 8.9"; +static char elsieid[] = "@(#)localtime.c 8.10"; #endif /* !defined NOID */ #endif /* !defined lint */ @@ -1889,6 +1889,10 @@ const long offset; int types[TZ_MAX_TYPES]; int okay; + if (tmp == NULL) { + errno = EINVAL; + return WRONG; + } if (tmp->tm_isdst > 1) tmp->tm_isdst = 1; t = time2(tmp, funcp, offset, &okay); @@ -1960,7 +1964,8 @@ time_t timelocal(tmp) struct tm * const tmp; { - tmp->tm_isdst = -1; /* in case it wasn't initialized */ + if (tmp != NULL) + tmp->tm_isdst = -1; /* in case it wasn't initialized */ return mktime(tmp); } @@ -1968,7 +1973,8 @@ time_t timegm(tmp) struct tm * const tmp; { - tmp->tm_isdst = 0; + if (tmp != NULL) + tmp->tm_isdst = 0; return time1(tmp, gmtsub, 0L); } @@ -1977,7 +1983,8 @@ timeoff(tmp, offset) struct tm * const tmp; const long offset; { - tmp->tm_isdst = 0; + if (tmp != NULL) + tmp->tm_isdst = 0; return time1(tmp, gmtsub, offset); } Modified: vendor/tzcode/dist/unused/tz-art.htm ============================================================================== --- vendor/tzcode/dist/unused/tz-art.htm Wed Feb 17 10:39:39 2010 (r204000) +++ vendor/tzcode/dist/unused/tz-art.htm Wed Feb 17 11:18:24 2010 (r204001) @@ -9,7 +9,7 @@ PUBLIC "-//W3C//DTD HTML 4.01//EN"

Time and the Arts

-@(#)tz-art.htm 8.15 +@(#)tz-art.htm 8.16

This file is in the public domain, so clarified as of @@ -366,6 +366,11 @@ premonition in the "We Had a Dream" epis (originally aired 2007-02-28).

  • +In the "30 Rock" episode "Anna Howard Shaw Day" (first broadcast 2010-02-11), +Jack Donaghy's date realizes that a Geneva-to-New-York business phone call +received in the evening must be fake given the difference in local times. +
  • +
  • In the 1946 movie "A Matter of Life and Death" (U.S. title "Stairway to Heaven") there is a reference to British Double Summer Time.