grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.14-36-gf1e1fb2


From: Jim Meyering
Subject: grep branch, master, updated. v2.14-36-gf1e1fb2
Date: Sat, 14 Sep 2013 04:55:44 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  f1e1fb2c5c1538c313f8488ef687b9a96684f54e (commit)
      from  bd58cfd715ae24de75103522e7af75c1909da0f1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=f1e1fb2c5c1538c313f8488ef687b9a96684f54e


commit f1e1fb2c5c1538c313f8488ef687b9a96684f54e
Author: Jim Meyering <address@hidden>
Date:   Sun Sep 8 10:49:52 2013 -0700

    dfa: appease a static analyzer, and save 95 stack bytes
    
    * src/dfa.c (MAX_BRACKET_STRING_LEN): Rename from BRACKET_BUFFER_SIZE
    and decrease from 128 to 32.
    (parse_bracket_exp): Add one byte more than MAX_BRACKET_STRING_LEN
    to the length of "str" buffer, to avoid appearance that we may store
    the trailing NUL beyond the end of buffer.  A string of length 32
    or greater is rejected by earlier processing, so would never reach
    this code.  Addresses http://bugs.gnu.org/15307

diff --git a/src/dfa.c b/src/dfa.c
index ad38d3b..b447a8a 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -975,8 +975,8 @@ parse_bracket_exp (void)
          dfa is ever called.  */
       if (c == '[' && (syntax_bits & RE_CHAR_CLASSES))
         {
-#define BRACKET_BUFFER_SIZE 128
-          char str[BRACKET_BUFFER_SIZE];
+#define MAX_BRACKET_STRING_LEN 32
+          char str[MAX_BRACKET_STRING_LEN + 1];
           FETCH_WC (c1, wc1, _("unbalanced ["));
 
           /* If pattern contains '[[:', '[[.', or '[[='.  */
@@ -990,7 +990,7 @@ parse_bracket_exp (void)
                   FETCH_WC (c, wc, _("unbalanced ["));
                   if ((c == c1 && *lexptr == ']') || lexleft == 0)
                     break;
-                  if (len < BRACKET_BUFFER_SIZE)
+                  if (len < MAX_BRACKET_STRING_LEN)
                     str[len++] = c;
                   else
                     /* This is in any case an invalid class name.  */

-----------------------------------------------------------------------

Summary of changes:
 src/dfa.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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