grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.6.2-24-g9dc58ee


From: Jim Meyering
Subject: grep branch, master, updated. v2.6.2-24-g9dc58ee
Date: Fri, 02 Apr 2010 08:55:23 +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  9dc58ee61f77d45738236eee3784c1d4bf8b916b (commit)
      from  2390067340d41aac6ed32f2faaec8b94d09f03e0 (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=9dc58ee61f77d45738236eee3784c1d4bf8b916b


commit 9dc58ee61f77d45738236eee3784c1d4bf8b916b
Author: Jim Meyering <address@hidden>
Date:   Fri Apr 2 09:51:18 2010 +0200

    grep: avoid used-undefined error with truncated multibyte input
    
    * src/dfa.c (addtok_wc): Don't use buf[0] (it's undefined) when
    wcrtomb returns <= 0.
    
    MBS_SUPPORT-removal: * src/dfa.c (dfastate):

diff --git a/src/dfa.c b/src/dfa.c
index c2ef18c..ba78b08 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -1175,6 +1175,13 @@ addtok_wc (wint_t wc)
   int i;
   memset (&s, 0, sizeof(s));
   cur_mb_len = wcrtomb ((char *) buf, wc, &s);
+
+  /* This is merely stop-gap.  When cur_mb_len is 0 or negative,
+     buf[0] is undefined, yet skipping the addtok_mb call altogether
+     can result in heap corruption.  */
+  if (cur_mb_len <= 0)
+    buf[0] = 0;
+
   addtok_mb(buf[0], cur_mb_len == 1 ? 3 : 1);
   for (i = 1; i < cur_mb_len; i++)
     {

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

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


hooks/post-receive
-- 
grep




reply via email to

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