svn commit: r274757 - stable/10/usr.bin/grep/regex

Ed Maste emaste at FreeBSD.org
Thu Nov 20 19:35:30 UTC 2014


Author: emaste
Date: Thu Nov 20 19:35:29 2014
New Revision: 274757
URL: https://svnweb.freebsd.org/changeset/base/274757

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

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

Modified: stable/10/usr.bin/grep/regex/tre-fastmatch.c
==============================================================================
--- stable/10/usr.bin/grep/regex/tre-fastmatch.c	Thu Nov 20 19:28:42 2014	(r274756)
+++ stable/10/usr.bin/grep/regex/tre-fastmatch.c	Thu Nov 20 19:35:29 2014	(r274757)
@@ -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-stable-10 mailing list