summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-09-25 19:22:26 +0000
committerpfg <pfg@FreeBSD.org>2014-09-25 19:22:26 +0000
commitbe5797835fa6b8de3832f892513c42321ce722c5 (patch)
tree795d16c46759ef00ede97e3c44a8dea5686bc04d /usr.bin/grep
parentf84ccf57abc43526a6aad8600c13520122444fcb (diff)
downloadFreeBSD-src-be5797835fa6b8de3832f892513c42321ce722c5.zip
FreeBSD-src-be5797835fa6b8de3832f892513c42321ce722c5.tar.gz
bsdgrep: Work-around for segmentation fault.
Fix by David Carlier. Obtained from: HardenedBSD PR: 167921 MFC after: 1 month
Diffstat (limited to 'usr.bin/grep')
-rw-r--r--usr.bin/grep/regex/tre-fastmatch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c
index eddab26..0881c55 100644
--- a/usr.bin/grep/regex/tre-fastmatch.c
+++ b/usr.bin/grep/regex/tre-fastmatch.c
@@ -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;
OpenPOWER on IntegriCloud