public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] fix(libc): Fix handle of %E & %O modifiers at end of format string
Date: Fri, 10 Nov 2023 11:16:25 +0100	[thread overview]
Message-ID: <ZU4C+UIcYTtvWrrJ@calimero.vinschen.de> (raw)
In-Reply-To: <4801ab90-2958-4fa2-87f2-21efdb41bbf4@Shaw.ca>

On Nov  9 23:17, Brian Inglis wrote:
> On 2023-11-09 12:04, Pedro Luis Castedo Cepeda wrote:
> > - Prevent strftime to parsing format string beyond its end when
> >    it finish with "%E" or "%O".
> > ---
> >   newlib/libc/time/strftime.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c
> > index 56f227c5f..c4e9e45a9 100644
> > --- a/newlib/libc/time/strftime.c
> > +++ b/newlib/libc/time/strftime.c
> > @@ -754,6 +754,8 @@ __strftime (CHAR *s, size_t maxsize, const CHAR *format,
> >         switch (*format)
> >   	{
> > +	case CQ('\0'):
> > +	  break;
> >   	case CQ('a'):
> >   	  _ctloc (wday[tim_p->tm_wday]);
> >   	  for (i = 0; i < ctloclen; i++)
> 
> These cases appear to already be taken care of by setting and using
> (depending on the config parameters) the "alt" variable for those modifiers,
> and the default: return 0; for the format *character* (possibly wide) not
> matching following any modifiers.
> 
> Patches to newlib should go to the newlib mailing list at sourceware dot org.

Also, a simple reproducer would be nice.


Thanks,
Corinna

  reply	other threads:[~2023-11-10 10:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 19:04 Pedro Luis Castedo Cepeda
2023-11-10  6:17 ` Brian Inglis
2023-11-10 10:16   ` Corinna Vinschen [this message]
2023-11-10 17:44     ` Pedro Luis Castedo Cepeda
2023-11-11  5:57       ` Brian Inglis
2023-11-11 17:29         ` Pedro Luis Castedo Cepeda
2023-11-13 16:42           ` Corinna Vinschen
2023-11-13 18:46             ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZU4C+UIcYTtvWrrJ@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).