diff options
author | Carlo Teubner <carlo.teubner@gmail.com> | 2010-08-28 16:19:16 -0600 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2013-09-17 20:39:31 +0700 |
commit | 95d7405a7540f91f67a505fa6458bde3d8e31f79 (patch) | |
tree | c65b90f3286c968b0209a4f495c7cd2f5c3d552a | |
parent | 37ea22baf81a4e3fc0896e3d6ac23d821ab1aa76 (diff) | |
download | m4-95d7405a7540f91f67a505fa6458bde3d8e31f79.tar.gz |
m4: avoid a crash with bad format string.
* src/format.c (expand_format): Fix off-by-one error.
* THANKS: Add Carlo Teubner.
Copyright-paperwork-exempt: Yes
Signed-off-by: Eric Blake <eblake@redhat.com>
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | modules/format.c | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -30,6 +30,7 @@ Brendan Kehoe brendan@cygnus.com Brian J. Fox bfox@datawave.net Brian D. Carlstrom bdc@clark.lcs.mit.edu Bruno Haible bruno@clisp.org +Carlo Teubner carlo.teubner@gmail.com Cesar Strauss cestrauss@gmail.com Charles Wilson cygwin@cwilson.fastmail.fm Chris McGuire chris@wso.net diff --git a/modules/format.c b/modules/format.c index b772290a..b13b2630 100644 --- a/modules/format.c +++ b/modules/format.c @@ -333,7 +333,7 @@ format (m4 *context, m4_obstack *obs, int argc, m4_macro_args *argv) } c = *fmt; - if (c > sizeof ok || !ok[c] || !f_len) + if (sizeof ok <= c || !ok[c] || !f_len) { m4_warn (context, 0, me, _("unrecognized specifier in %s"), quotearg_style_mem (locale_quoting_style, f, M4ARGLEN (1))); |