[pcre-dev] possible lookaround bug

Página Principal
Apagar esta mensagem
Autor: Joel Uckelman
Data:  
Para: pcre-dev@exim.org
Assunto: [pcre-dev] possible lookaround bug
Hi,

I'm using libpcre's search output to validate the output of a (mostly) PCRE-compatible multipattern search library I've worked on, called liblightgrep. I wrote a pattern generator to help with this; a consequence of that is that I've run some odd patterns through libpcre, to the extent that you could say I've been fuzzing it at the pattern level. (libpcre has performed admirably, btw. I've had nothing to report until now.) There's a particular odd pattern I encountered this morning which I think is not handled properly.

When I try this with PCRE 8.33 on Fedora 20, I get what appears to be an infinite loop:

echo -n a | pcregrep -o '(?<=\Ka)'

pcregrep prints 'a', one per line, until I kill it.

It looks as though the problem has something to do with the '-o' flag, as

echo -n a | pcregrep '(?<=\Ka)'

prints 'a' once and exits.

(?<=\Ka) is obviously not a useful pattern, but reporting matches on it (rather than matching lines) shouldn't put pcregrep into an infinite loop. My test program which uses libpcre also gets into an infinite loop on this pattern, which suggests that the problem is in the library rather than in pcregrep.

Any ideas about this?



Joel Uckelman
Senior Developer

STROZ FRIEDBERG
Capital House, 85 King William Street, London EC4N 7BL

T: +44 20.7061.2239
M: +44 79.6478.7296
F: +44 20 7061 2201
juckelman@??? www.strozfriedberg.com

This message and/or its attachments may contain information that is confidential and/or protected by privilege from disclosure. If you have reason to believe you are not the intended recipient, please immediately notify the sender by reply e-mail or by telephone, then delete this message (and any attachments), as well as all copies, including any printed copies. Thank you.

Stroz Friedberg Limited is a company registered in England and Wales No: 4150500, Registered office: Capital House, 85 King William Street, London EC4N 7BL, VAT registration No: 783 1701 29.