[pcre-dev] [Bug 843] PCRE library segfaults on random input

Kezdőlap
Üzenet törlése
Szerző: Philip Hazel
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 843] PCRE library segfaults on random input
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=843




--- Comment #3 from Philip Hazel <ph10@???> 2009-04-22 10:07:48 ---
On Tue, 21 Apr 2009, Mark wrote:

> I hope the small test program is helpful for you.


When I try your test program, the output I get is:

error:regcomp:unknown error code
Segmentation fault

The segfault is not surprising - if the compile fails, you can't expect
the exec to work. Your program ploughs on, even after a compile error,
when the value of regexp will not be valid.

Now, there obviously is some problem there, because "unknown error code"
is not right. Testing your pattern with pcretest, I get

"Pp\,-`],6QdE=%(bbjg8=g5DZao4D8^fM'I/>#Pw]XSjiFI@(?+a2l#t*1(HDA"
Failed: digit expected after (?+ at offset 51

This should end up with a BADPAT error from regcomp. Looking at the
code, I see that there is an error in the tables that handle compile
errors. I'll fix it for the next release, but I don't see it as hugely
urgent.

But now the question remains: why is there no "error:regcomp:..."
message in the output you posted?

Regards,
Philip


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email