From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.2 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by inbox.vuxu.org (OpenSMTPD) with SMTP id 72db584d for ; Sat, 22 Feb 2020 22:01:30 +0000 (UTC) Received: (qmail 19596 invoked by uid 550); 22 Feb 2020 22:01:28 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 19563 invoked from network); 22 Feb 2020 22:01:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=pVpPISGNPeb8H 3iODkL9566UkkxX0CpmArM+AfKEGFM=; b=u+u/nMO+peE9HwWGtlCmz1MQNtjjI wq8bgYSu5T9jVrE0I2SDbKiwSUpJXyjQU9IcUnTOnb6SjxvCVEVZ1rLCaXse55l7 iaMYZvdfN/b1ounJtTloYY0fnm6XZS3bgdd6SAvNgW9ycmq7XB1IegM+qGz6d5uu eZgh8AYAHY0biEc9Q7lmhLPWSSw+bDCy502ctoVcwZOefwR2KBAyQzwNhEDJy91U Y6V/1vTwsc1+3JlZrVy17NdHgR7JFjqWznArrQYIuH2Zb1h+GIRDxvjLEuINMokp vgfLcfe+Rc3AemjcSv1//5Fo4znhelpPhphr8EsQ6ibZC7/tl5mmvX1Nw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=pVpPISGNPeb8H3iODkL9566UkkxX0CpmArM+AfKEGFM=; b=nHwpm+cK wikNMl55X1O3zvwe1yP20oGxy4X4JXmcD+OcAC+ukmKbkNGofFkrqKzQSNiHXh0U e0P/m4HEEr81+ReNUbOonEDgspA0a68pT7Vz4PJU4ovRz//Qt2sm9AAsksowwit3 h3TQsPycqtfwuDlu8qispATJUquTuup556EtkaDLIGLiflSOlWY49LqCaW5VsmId z1ubEkry1oXgqRClsJQuQifplXyCPG6me9Ytik84xKCIE8tOdhTpQx9HkAkywOzf 5Tu3WzLGpZ53z40JeuXdEruxVXLKE/S0nIj788gUwP7dz6UpHFpt+yNmDPF5m7XZ ak0LdRWI3EwHIQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrkeeigdduheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepufgrmhhuvghlucfjohhllhgrnhguuceoshgrmhhuvghlsehs hhholhhlrghnugdrohhrgheqnecukfhppeejtddrudefhedrudegkedrudehudenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhes shhhohhllhgrnhgurdhorhhg X-ME-Proxy: From: Samuel Holland To: musl@lists.openwall.com Cc: Samuel Holland Date: Sat, 22 Feb 2020 16:01:13 -0600 Message-Id: <20200222220113.55710-2-samuel@sholland.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200222220113.55710-1-samuel@sholland.org> References: <20200222220113.55710-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH 2/2] Fix parsing offsets after long timezone names TZ containg a timezone name with >TZNAME_MAX characters currently breaks musl's timezone parsing. getname() stops after TZNAME_MAX characters. getoff() will consume no characters (because the next character is not a digit) and incorrectly return 0. Then, because there are remaining alphabetic characters, __daylight == 1, and dst_off == -3600. getname() must consume the entire timezone name, even if it will not fit in d/__tzname, so when it returns, s points to the offset digits. --- This was causing a failure in gnulib test-parse-datetime, which tries to use a timezone of 2000 "X"s followed by "0". --- src/time/__tz.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/time/__tz.c b/src/time/__tz.c index a962960e..49a7371e 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -86,15 +86,15 @@ static void getname(char *d, const char **p) int i; if (**p == '<') { ++*p; - for (i=0; (*p)[i] && (*p)[i]!='>' && i