HomeFreeBSD

bsdgrep: fix segfault with --mmap and add relevant test

Description

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)

Details

Provenance
kevansAuthored on
Parents
rS322607: bsdgrep: Don't allow negative context flags, add more tests
Branches
Unknown
Tags
Unknown