bsdgrep: Work-around for segmentation fault.

Fix by David Carlier.

Obtained from:	HardenedBSD
PR:		167921
MFC after:	1 month
This commit is contained in:
Pedro F. Giffuni 2014-09-25 19:22:26 +00:00
parent fd29269606
commit 55a803b32a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272127

View file

@ -727,7 +727,7 @@ tre_compile_fast(fastmatch_t *fg, const tre_char_t *pat, size_t n,
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;