m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: head: Re: branch-1_4 allow cross-compiles; expose buffer overrun


From: Eric Blake
Subject: Re: head: Re: branch-1_4 allow cross-compiles; expose buffer overrun
Date: Mon, 17 Jul 2006 17:09:28 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

>       * modules/format.c (includes): Use xvasprintf.h.
>       (format): Make static.  Avoid buffer overflow, that can lead to
>       arbitrary code execution exploit.  Only pass unsigned char to
>       is*().  Support F, g, and G specifiers.

These new specifiers were so easy to support, and I already have to roll 1.4.6, 
so here goes a backport to the branch:

2006-07-17  Eric Blake  <address@hidden>

        * src/format.c (format): Support F, g, and G specifiers.
        * doc/m4.texinfo (Format): Document this.
        * NEWS: Document this addition.

Index: NEWS
===================================================================
RCS file: /sources/m4/m4/NEWS,v
retrieving revision 1.1.1.1.2.40
diff -u -r1.1.1.1.2.40 NEWS
--- NEWS        17 Jul 2006 16:35:12 -0000      1.1.1.1.2.40
+++ NEWS        17 Jul 2006 17:07:50 -0000
@@ -4,8 +4,9 @@
 
 Version 1.4.6 - ?? 2006, by ??  (CVS version 1.4.5a)
 
-* Fix buffer overrun in regex and patsubst macros when handed a trailing
+* Fix buffer overrun in regexp and patsubst macros when handed a trailing
   backslash in the replacement text.
+* The format macro now understands %F, %g, and %G.
 
 Version 1.4.5 - 15 July 2006, by Eric Blake  (CVS version 1.4.4c)
 
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.47
diff -u -r1.1.1.1.2.47 m4.texinfo
--- doc/m4.texinfo      17 Jul 2006 16:53:00 -0000      1.1.1.1.2.47
+++ doc/m4.texinfo      17 Jul 2006 17:07:50 -0000
@@ -3328,9 +3328,10 @@
 @end example
 
 The builtin @code{format} is modeled after the ANSI C @samp{printf}
-function, and supports the normal @samp{%} specifiers: @samp{c},
+function, and supports these @samp{%} specifiers: @samp{c},
 @samp{s}, @samp{d}, @samp{o}, @samp{x}, @samp{X}, @samp{u}, @samp{e},
address@hidden and @samp{f}; it supports field widths and precisions, and the
address@hidden, @samp{f}, @samp{F}, @samp{g}, @samp{G}, and @samp{%}; it
+supports field widths and precisions, and the
 modifiers @samp{+}, @samp{-}, @address@hidden }}, @samp{0}, @samp{#}, @samp{h} 
and
 @samp{l}.  For more details on the functioning of @code{printf}, see the
 C Library Manual.
Index: src/format.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/format.c,v
retrieving revision 1.1.1.1.2.3
diff -u -r1.1.1.1.2.3 format.c
--- src/format.c        30 Jun 2006 03:38:49 -0000      1.1.1.1.2.3
+++ src/format.c        17 Jul 2006 17:07:50 -0000
@@ -200,6 +200,9 @@
        case 'e':
        case 'E':
        case 'f':
+       case 'F':
+       case 'g':
+       case 'G':
          datatype = DOUBLE;
          break;
 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]