grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.20-55-gd43ec98


From: Jim Meyering
Subject: grep branch, master, updated. v2.20-55-gd43ec98
Date: Sun, 05 Oct 2014 05:00:24 +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  d43ec98e01b2135650bb677cab0c3dde53b0c399 (commit)
      from  4a9a21121c9156077a77a8587f8c43f8b940d259 (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=d43ec98e01b2135650bb677cab0c3dde53b0c399


commit d43ec98e01b2135650bb677cab0c3dde53b0c399
Author: Jim Meyering <address@hidden>
Date:   Sat Oct 4 20:25:02 2014 -0700

    grep: avoid stack buffer read-underrun and overrun
    
    Testing binaries built with -fsanitize=address caused aborts due
    to stack underrun and overrun.
    * src/grep.c (main): Allocate a larger buffer for eolbytes:
    one byte before the beginning and one more after the end.
    For details, see http://debbugs.gnu.org/18580#44.

diff --git a/src/grep.c b/src/grep.c
index 7475ea1..9dcf298 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -2513,9 +2513,10 @@ main (int argc, char **argv)
 
   compile (keys, keycc);
   free (keys);
-  char eolbytes[2] = { eolbyte };
+  /* We need one byte prior and at least two after.  */
+  char eolbytes[4] = { 0, eolbyte, 0, 0 };
   size_t match_size;
-  skip_empty_lines = ((execute (eolbytes, 1, &match_size, NULL) == 0)
+  skip_empty_lines = ((execute (eolbytes + 1, 1, &match_size, NULL) == 0)
                       == out_invert);
 
   if ((argc - optind > 1 && !no_filenames) || with_filenames)

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

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


hooks/post-receive
-- 
grep



reply via email to

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