GNU bug report logs - #18266
grep -P and invalid exits with error

Previous Next

Package: grep;

Reported by: Santiago <santiago <at> debian.org>

Date: Thu, 14 Aug 2014 15:43:02 UTC

Severity: wishlist

Merged with 18455

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: Eric Blake <eblake <at> redhat.com>
To: Santiago <santiago <at> debian.org>, Paul Eggert <eggert <at> cs.ucla.edu>, 758105 <at> bugs.debian.org
Cc: 18266 <at> debbugs.gnu.org, Vincent Lefevre <vincent <at> vinc17.net>
Subject: bug#18266: grep -P and invalid exits with error
Date: Fri, 29 Aug 2014 06:58:17 -0600
[Message part 1 (text/plain, inline)]
On 08/28/2014 11:47 PM, Santiago wrote:
> El 16/08/14 a las 11:36, Paul Eggert escribió:
>> > Santiago wrote:
>>> > >Another solution would be to don't check if binary files are valid
>>> > >(passing PCRE_NO_UTF8_CHECK to pcre_exec), but I don't know if that'd
>>> > >avoid security holes
>> > 
>> > It wouldn't.  (We already tried it.)
>> > 
> Another try. This patch is by far more efficient.

> * src/pcresearch.c (Pexecute): When pcre_exec returns an invalid
> UTF8 character error, copies line_buf to an auxiliar buffer,

s/auxiliar/auxiliary/

> removes invalid characters and evaluates against it.
> * tests/pcre-infloop: Exit status is 1 again.
> * tests/pcre-invalid-utf8-input: Check again if grep doesn't
> abort. Also cheks for match after a second invalid character

s/cheks/checks/


> +          /* Change invalid UTF-8 characters (according to pcre_exec) to '\0' */
> +          while (e == PCRE_ERROR_BADUTF8){

Space before {

> +            line_utf8_clean[sub[0]+invalid_pos] = '\0';

Spaces around +

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

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

Previous Next


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