Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260330192722.GJ1827@brightrain.aerifal.cx>
Date: Mon, 30 Mar 2026 15:27:22 -0400
From: Rich Felker <dalias@...c.org>
To: Hannu Nyman <hannu.nyman@....fi>
Cc: musl@...ts.openwall.com, Shiji Yang <yangshiji66@...look.com>
Subject: Re: strptime in 1.2.6 - is tzname[0/1] guaranteed to be set?

On Mon, Mar 30, 2026 at 10:05:33PM +0300, Hannu Nyman wrote:
> Rich Felker kirjoitti 23.3.2026 klo 19.38:
> > On Mon, Mar 23, 2026 at 06:38:07PM +0200, Hannu Nyman wrote:
> > > Is a new patch version still coming, or was the last one ("the attached is
> > > good") already fine?
> > Here's a fixed one,
> > 
> 
> Hello Rich,
> 
> the current patch version seems to be still somewhat problematic regarding
> the fallback 'else' part.
> 
> +    } else {
> +        /* FIXME: is this supposed to be an error? */
> +        while ((**s|32)-'a' <= 'z'-'a') ++*s;
> +    }
> 
> To my understanding the part is supposed to consume the alpha chars of the
> passed timezone name string and then enable further parsing of the total
> date stamp with other possible %-modifiers. Apparently the current check
> fails to stop at null \0 and may continue further, causing segmentation
> error at some point.

Oh, it's a signedness error. Changing it to

	while ((**s|32)-'a' < 26U) ++*s;

would fix it. But isalpha might be a nicer approach, yes, especially
since we have the macro that does exactly that anyway.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.