HomeFreeBSD

MFC r303676:

Description

MFC r303676:

Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"
or "+" (these are invalid, because there is no preceding operand).

When bsdgrep attempts to emulate GNU grep in discarding and ignoring the
invalid ? or + operators, some later logic in tre_compile_fast() goes
beyond the end of the buffer, leading to a crash.

Fix this by bailing out, and reporting a bad pattern instead.

Approved by: re (gjb, kib)
Reported by: Steve Kargl

Details

Provenance
dimAuthored on
Parents
rS303887: Add a dmardump utility to dump the VT-d context tables.
Branches
Unknown
Tags
Unknown