svn commit: r272127 - head/usr.bin/grep/regex

Pedro F. Giffuni pfg at FreeBSD.org
Thu Sep 25 19:22:27 UTC 2014


Author: pfg
Date: Thu Sep 25 19:22:26 2014
New Revision: 272127
URL: http://svnweb.freebsd.org/changeset/base/272127

Log:
  bsdgrep: Work-around for segmentation fault.
  
  Fix by David Carlier.
  
  Obtained from:	HardenedBSD
  PR:		167921
  MFC after:	1 month

Modified:
  head/usr.bin/grep/regex/tre-fastmatch.c

Modified: head/usr.bin/grep/regex/tre-fastmatch.c
==============================================================================
--- head/usr.bin/grep/regex/tre-fastmatch.c	Thu Sep 25 19:10:32 2014	(r272126)
+++ head/usr.bin/grep/regex/tre-fastmatch.c	Thu Sep 25 19:22:26 2014	(r272127)
@@ -727,7 +727,7 @@ badpat:
       for (unsigned int i = 0; i < fg->len; i++)
 	if (fg->pattern[i] == '\\')
 	  escaped = !escaped;
-	else if (fg->pattern[i] == '.' && escaped)
+	else if (fg->pattern[i] == '.' && fg->escmap && escaped)
 	  {
 	    fg->escmap[i] = true;
 	    escaped = false;


More information about the svn-src-all mailing list