public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] fix(libc): Fix handle of %E & %O modifiers at end of format string
@ 2023-11-09 19:04 Pedro Luis Castedo Cepeda
  2023-11-10  6:17 ` Brian Inglis
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Luis Castedo Cepeda @ 2023-11-09 19:04 UTC (permalink / raw)
  To: cygwin-patches; +Cc: Pedro Luis Castedo Cepeda

- 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++)
-- 
2.42.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-13 18:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-09 19:04 [PATCH] fix(libc): Fix handle of %E & %O modifiers at end of format string Pedro Luis Castedo Cepeda
2023-11-10  6:17 ` Brian Inglis
2023-11-10 10:16   ` Corinna Vinschen
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

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).