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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to