public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: fweimer@redhat.com (Florian Weimer)
To: libc-alpha@sourceware.org
Subject: [PATCH] vfprintf: Avoid creating a VLA which complicates stack management
Date: Fri, 02 Sep 2016 10:57:00 -0000	[thread overview]
Message-ID: <20160902105723.8655D4019BD96@oldenburg.str.redhat.com> (raw)

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;							      \
 									      \

             reply	other threads:[~2016-09-02 10:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 10:57 Florian Weimer [this message]
2016-09-02 13:09 ` Andreas Schwab

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=20160902105723.8655D4019BD96@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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).