Subject: Re: bug#18806: grep -rP getline crashes prematurely (without displaying all results) on invalid UTF-8 input with LC_ALL=en_US.UTF-8

From: Shlomi Fish <[email-masked]>
Date: Fri, 24 Oct 2014 19:50:26 +0300

On Sat, 25 Oct 2014 01:45:42 +0900
Norihiro Tanaka <[email-masked]> wrote:

> Shlomi Fish <[email-masked]> write:
> > `which grep` --color -rP getline grep-test
> 
> If -o or --color option is specified, may be line_end < validated in
> longest exact match.  As a result, a negative value is set to
> `search_bytes'.
> 
> I improved validation for input buffer in order to fix the bug.
> However, possibly it may cause slowdown.

thanks for the patch!

Regards,

	-- Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Star Trek: “We, the Living Dead” - http://shlom.in/st-wtld

Yesterday I asked one of my students if she knew what an encyclopedia is, and
she said: “Is it something like Wikipedia?”.
        — http://twitter.com/alisonclement/status/8421314259

Please reply to list if it's a mailing list post - http://shlom.in/reply .