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

Previous Next

Package: grep;

Reported by: Shlomi Fish <shlomif <at> shlomifish.org>

Date: Thu, 23 Oct 2014 11:16:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Shlomi Fish <shlomif <at> shlomifish.org>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 18806 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>
Subject: bug#18806: grep -rP getline crashes prematurely (without displaying all results) on invalid UTF-8 input with LC_ALL=en_US.UTF-8
Date: Fri, 24 Oct 2014 19:50:26 +0300
On Sat, 25 Oct 2014 01:45:42 +0900
Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:

> Shlomi Fish <shlomif <at> shlomifish.org> 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 .




This bug report was last modified 10 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.