Re: [pcre-dev] Memory corruption in PCRE compile (Version 6.…

Pàgina inicial
Delete this message
Autor: Philip Hazel
Data:  
A: Vinayaka Bhat
CC: 'pcre-dev@exim.org'
Assumpte: Re: [pcre-dev] Memory corruption in PCRE compile (Version 6.6) for invalid regex
On Wed, 14 Oct 2009, Vinayaka Bhat wrote:

> Eg of an invalid regex: (*)
>
> In this case only an asterisk is provided(An asterisk cannot be the
> first element in a regex)
>
> I would grateful if you could confirm the behaviour for this regex.


Here is the output of testing this regex with 7.9, using the "pcretest"
program running under valgrind, to check for memory errors:

$ valgrind pcretest
==4740== Memcheck, a memory error detector.
==4740== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==4740== Using LibVEX rev 1884, a library for dynamic binary translation.
==4740== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==4740== Using valgrind-3.4.1, a dynamic binary instrumentation framework.
==4740== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==4740== For more details, rerun with: -v
==4740==
PCRE version 7.9 2009-04-11

re> /(*)/

Failed: nothing to repeat at offset 1
re>

==4740==
==4740== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from 1)
==4740== malloc/free: in use at exit: 0 bytes in 0 blocks.
==4740== malloc/free: 4 allocs, 4 frees, 150,180 bytes allocated.
==4740== For counts of detected errors, rerun with: -v
==4740== All heap blocks were freed -- no leaks are possible.

I ran this on a Gentoo Linux system. Testing the forthcoming 8.00
release gives exactly the same result.

Philip

--
Philip Hazel