diff options
author | Carlo Teubner <carlo.teubner@gmail.com> | 2010-08-30 14:47:16 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-08-30 15:04:21 -0600 |
commit | 6262484d69f374aad1dea0abfb33d248fafa8dc9 (patch) | |
tree | e92d00913f432986958d54878ebc29f77115db05 | |
parent | 94f32f61766ea4758ee217277435a9200bc18145 (diff) | |
download | m4-6262484d69f374aad1dea0abfb33d248fafa8dc9.tar.gz |
Avoid a crash with bad format string.
* src/format.c (expand_format): Fix off-by-one error.
Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 5d1faf478e162ad64075cfdc51ffca697ec7f599)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/format.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2010-08-30 Carlo Teubner <carlo.teubner@gmail.com> (tiny change) + + Avoid a crash with bad format string. + * src/format.c (expand_format): Fix off-by-one error. + 2010-08-30 Eric Blake <eblake@redhat.com> Document recent bug fixes. diff --git a/src/format.c b/src/format.c index 41bc3c98..8cfb7601 100644 --- a/src/format.c +++ b/src/format.c @@ -329,7 +329,7 @@ expand_format (struct obstack *obs, int argc, macro_arguments *argv) } c = *fmt; - if (c > sizeof ok || !ok[c] || !f_len) + if (sizeof ok <= c || !ok[c] || !f_len) { m4_warn (0, me, _("unrecognized specifier in %s"), quotearg_style_mem (locale_quoting_style, f, ARG_LEN (1))); |