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


Message #14 received at 18806 <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: Shlomi Fish <shlomif <at> shlomifish.org>
Cc: 18806 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>
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
Date: Sat, 25 Oct 2014 01:45:42 +0900
[Message part 1 (text/plain, inline)]
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.
[0001-grep-improvement-of-validation-for-input-buffer-in-g.patch (text/plain, attachment)]

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.