From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 678083858D37 for ; Thu, 22 Jun 2023 15:21:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 678083858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id A2358211B9; Thu, 22 Jun 2023 15:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687447296; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iRJZpvZjbsB2+9Eh8ZkTKTZp5ETGS/6HdZ4tAtZdF0c=; b=BzgIqFqX4lLgvA8xFo6x4QsvIhcNcpyLhj4VyQK4zWGQ+OHKjYKasfdMq8h+4za4UFTY03 n1PUGsWBVQlwFnV9TST5SqVVcqWz7eVUgzlfs02RV2Hz9Zm3jdJCqHuBtVxupp+ElgpkbR kIFVVyur3bPfEM61Ovwgi0OrxvHMER8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687447296; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iRJZpvZjbsB2+9Eh8ZkTKTZp5ETGS/6HdZ4tAtZdF0c=; b=Rg5h+A4DINe6wufzyTOQfpkMgMbVz0VsPpDv5B9z8fofY8qPLQWRGUYjtqI8RFkAH0+kAz efUr02RqOyXWfCAQ== Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id 949612C141; Thu, 22 Jun 2023 15:21:36 +0000 (UTC) Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id 7FA884AACF4; Thu, 22 Jun 2023 17:21:36 +0200 (CEST) From: Andreas Schwab To: Stanley Lancaster via Libc-alpha Cc: Stanley Lancaster Subject: Re: [PATCH] Fix %Z parsing in strptime [BZ #16088] In-Reply-To: <20230622150021.3828261-1-lancasterharp@gmail.com> (Stanley Lancaster via Libc-alpha's message of "Thu, 22 Jun 2023 10:00:21 -0500") References: <20230622150021.3828261-1-lancasterharp@gmail.com> X-Yow: I'm gliding over a NUCLEAR WASTE DUMP near ATLANTA, Georgia!! Date: Thu, 22 Jun 2023 17:21:36 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Jun 22 2023, Stanley Lancaster via Libc-alpha wrote: > %Z parsing terminated on space, should've terminated on next character in format string > > Author: Stanley Lancast > --- > time/strptime_l.c | 5 +++-- > time/tst-strptime.c | 1 + > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/time/strptime_l.c b/time/strptime_l.c > index 85c3249fcc..5f96795406 100644 > --- a/time/strptime_l.c > +++ b/time/strptime_l.c > @@ -772,8 +772,9 @@ __strptime_internal (const char *rp, const char *fmt, struct tm *tmp, > /* Read timezone but perform no conversion. */ > while (ISSPACE (*rp)) > rp++; > - while (!ISSPACE (*rp) && *rp != '\0') > - rp++; > + > + while (*rp != *(fmt) && *rp != '\0') > + rp++; The next character could be '%'. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."