svn commit: r247294 - stable/9/usr.bin/grep/regex

Mark Johnston markj at FreeBSD.org
Tue Feb 26 00:44:55 UTC 2013


Author: markj
Date: Tue Feb 26 00:44:54 2013
New Revision: 247294
URL: http://svnweb.freebsd.org/changeset/base/247294

Log:
  MFC r246917:
    Strengthen the check in IS_OUT_OF_BOUNDS to ensure that (j - 1) is a
    valid index into the input buffer.
  
  Approved by:	rstone (co-mentor)

Modified:
  stable/9/usr.bin/grep/regex/tre-fastmatch.c
Directory Properties:
  stable/9/usr.bin/grep/   (props changed)

Modified: stable/9/usr.bin/grep/regex/tre-fastmatch.c
==============================================================================
--- stable/9/usr.bin/grep/regex/tre-fastmatch.c	Tue Feb 26 00:43:01 2013	(r247293)
+++ stable/9/usr.bin/grep/regex/tre-fastmatch.c	Tue Feb 26 00:44:54 2013	(r247294)
@@ -103,7 +103,7 @@ static int	fastcmp(const fastmatch_t *fg
   ((!fg->reversed							\
     ? ((type == STR_WIDE) ? ((j + fg->wlen) > len)			\
 			  : ((j + fg->len) > len))			\
-    : (j < 0)))
+    : (j <= 0)))
 
 /*
  * Checks whether the new position after shifting in the input string


More information about the svn-src-stable-9 mailing list