Author: pfg
Date: Sun Jul 12 15:24:05 2015
New Revision: 285419
URL: https://svnweb.freebsd.org/changeset/base/285419

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

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 Sun Jul 12 09:42:10 2015        
(r285418)
+++ stable/9/usr.bin/grep/regex/tre-fastmatch.c Sun Jul 12 15:24:05 2015        
(r285419)
@@ -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