public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] vfprintf: Avoid creating a VLA which complicates stack management
@ 2016-09-02 10:57 Florian Weimer
  2016-09-02 13:09 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2016-09-02 10:57 UTC (permalink / raw)
  To: libc-alpha

2016-09-02  Florian Weimer  <fweimer@redhat.com>

	* stdio-common/vfprintf.c (process_string_arg): Use MB_LEN_MAX
	instead of MB_CUR_MAX to avoid variable-length array.

diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 6e428e9..13ab47a 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1082,7 +1082,7 @@ static const uint8_t jump_table[] =
     LABEL (form_wcharacter):						      \
       {									      \
 	/* Wide character.  */						      \
-	char buf[MB_CUR_MAX];						      \
+	char buf[MB_LEN_MAX];						      \
 	mbstate_t mbstate;						      \
 	size_t len;							      \
 									      \

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

* Re: [PATCH] vfprintf: Avoid creating a VLA which complicates stack management
  2016-09-02 10:57 [PATCH] vfprintf: Avoid creating a VLA which complicates stack management Florian Weimer
@ 2016-09-02 13:09 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2016-09-02 13:09 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Sep 02 2016, fweimer@redhat.com (Florian Weimer) wrote:

> 	* stdio-common/vfprintf.c (process_string_arg): Use MB_LEN_MAX
> 	instead of MB_CUR_MAX to avoid variable-length array.

Ok.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

end of thread, other threads:[~2016-09-02 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02 10:57 [PATCH] vfprintf: Avoid creating a VLA which complicates stack management Florian Weimer
2016-09-02 13:09 ` Andreas Schwab

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