]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix bug: Avoid out-of-bounds access.
authorBruno Haible <bruno@clisp.org>
Mon, 24 May 2010 08:53:29 +0000 (10:53 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 3 Jun 2010 13:03:47 +0000 (15:03 +0200)
gettext-tools/libgrep/ChangeLog
gettext-tools/libgrep/m-regex.c

index a229582f6f20e5dc8e8aa9f38ac2169b7d77480f..0e3951701887b9a37e999cb11fc31e802fd72e6f 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-24  Bruno Haible  <bruno@clisp.org>
+
+       Fix bug: Avoid out-of-bounds access.
+       * m-regex.c (EGexecute): Fix test before second call to
+       IS_WORD_CONSTITUENT.
+
 2010-05-24  Bruno Haible  <bruno@clisp.org>
 
        Cleanup syntax.
index d4b49b98cf0d209598fbeccc544596a6412a10d9..e3582bcb42b6af6e4e1fd25238819f42620f467c 100644 (file)
@@ -193,7 +193,7 @@ EGexecute (const void *compiled_pattern,
                 while (start >= 0)
                   {
                     if ((start == 0 || !IS_WORD_CONSTITUENT ((unsigned char) beg[start - 1]))
-                        && (len == end - beg
+                        && (start + len == end - beg
                             || !IS_WORD_CONSTITUENT ((unsigned char) beg[start + len])))
                       goto success;
                     if (len > 0)