GNU bug report logs - #23983
[PATCH] grep: fix crash with a pattern of alternation of two same characters

Previous Next

Package: grep;

Reported by: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Date: Thu, 14 Jul 2016 15:08:01 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


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

From: Eric Blake <eblake <at> redhat.com>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>, 23983 <at> debbugs.gnu.org
Subject: Re: bug#23983: [PATCH] grep: fix crash with a pattern of alternation
 of two same characters
Date: Thu, 14 Jul 2016 11:28:56 -0600
[Message part 1 (text/plain, inline)]
On 07/14/2016 09:07 AM, Norihiro Tanaka wrote:
> Current master crashes with below.
> 
> $ printf '0\n0' >pat
> $ printf '0\n' >in
> $ env LC_ALL=C grep -F pat in
> 
> grep -F uses memchr2() for each character in this pattern, but if two
> characters is same, the trie has no child.

memchr2() should already be handling the special case of the same
character requested twice, without clients having to code around it.

-- 
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 8 years and 364 days ago.

Previous Next


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