From patchwork Mon Dec 6 14:50:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Wong X-Patchwork-Id: 48538 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2235B3858436 for ; Mon, 6 Dec 2021 14:51:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2235B3858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638802262; bh=qr/UONzYXm319I6cguKV8JTsSLDNVufK/cAxYmVwvso=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=HZyy/sNc+aV+u/rdVAcxgGBhd40fQYbc1zLPml/WV52aWyOF4w7JSHLY8lfghxSeH fG1Yfz2NL4H2I2CoaJEcE+vCd2W6aZMoLhzmt0b5S8XVaqkpXLjPQoTu4VyeMRtCjK D9fmzIUwvpznoKUbA6r2Ip2ea23pb+AX6fn3f7Ro= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 9F1083858D28 for ; Mon, 6 Dec 2021 14:50:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F1083858D28 To: "libc-alpha@sourceware.org" Subject: [PATCH] time: Remove assert in reading of tz file Thread-Topic: [PATCH] time: Remove assert in reading of tz file Thread-Index: AQHX6q+3QCWpzqvp1EmFDCttKhXp/A== Date: Mon, 6 Dec 2021 14:50:39 +0000 Message-ID: Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.0.5.60] MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Disposition: attachment; filename="0001-time-Remove-assert-in-reading-of-tz-file.patch"; size=1393; creation-date="Mon, 06 Dec 2021 14:49:16 GMT"; modification-date="Mon, 06 Dec 2021 14:49:16 GMT" Content-Description: 0001-time-Remove-assert-in-reading-of-tz-file.patch X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christopher Wong via Libc-alpha From: Christopher Wong Reply-To: Christopher Wong Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" From d1f0f7a09765ce7bb80d7d6bdd00e39bf7ca5d54 Mon Sep 17 00:00:00 2001 From: Christopher Wong Date: Mon, 6 Dec 2021 14:48:33 +0100 Subject: [PATCH] time: Remove assert in reading of tz file To: libc-alpha@sourceware.org The assumption of "__tzname[0] == NULL" then there must be no transition and "num_types == 1" is obsolete. The case when the tz file is truncated then "__tzname[0] == NULL" happens even when there is one transition. The "num_types == 1" is kept up to version 2021c of the tzdb. Starting from version 2021d of the tzdb the truncation introduces "-00" time zone abbreviations for intervals with Universal Time (UT) offsets that are unspecified. In other words, it means "num_types == 2". --- time/tzfile.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/time/tzfile.c b/time/tzfile.c index 190a777152..874e10c9c7 100644 --- a/time/tzfile.c +++ b/time/tzfile.c @@ -429,12 +429,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap) } } if (__tzname[0] == NULL) - { - /* This should only happen if there are no transition rules. - In this case there should be only one single type. */ - assert (num_types == 1); - __tzname[0] = __tzstring (zone_names); - } + __tzname[0] = __tzstring (zone_names); if (__tzname[1] == NULL) __tzname[1] = __tzname[0]; -- 2.20.1