]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bsdgrep: fix segfault with --mmap and add relevant test
authorkevans <kevans@FreeBSD.org>
Thu, 17 Aug 2017 04:18:31 +0000 (04:18 +0000)
committerkevans <kevans@FreeBSD.org>
Thu, 17 Aug 2017 04:18:31 +0000 (04:18 +0000)
commit66ff5b080a97728a17f338222b1bec9dff646980
tree328cfdef7c173533a5e05cbd25a60faf4103ef1f
parente4d500149703035432c35df48506b8bf7237edef
bsdgrep: fix segfault with --mmap and add relevant test

MFC r318565: bsdgrep: fix segfault with --mmap

r313948 partially fixed --mmap behavior but was incomplete.  This commit
generally reverts it and does it the more correct way- by just consuming
the rest of the buffer and moving on.

MFC r318908: bsdgrep: add --mmap tests

Basic sanity tests as well as coverage for the bug fixed in r318565.

PR: 219402
Approved by: emaste (mentor, blanket MFC)
contrib/netbsd-tests/usr.bin/grep/t_grep.sh
usr.bin/grep/file.c