[Libreoffice] [PUSHED] [PATCH] Re: Easy hack regex compile infinite loop ( bug 41738 )

Noel Power nopower at suse.com
Fri Nov 11 05:45:40 PST 2011


On 11/11/11 05:44, Karl Koehler wrote:
> Hi,
>
> investigating further I have come to the conclusion that the attached
> ( and previously inlined ) patch is correct, in the sense that regular
> expressions of the failing type are now handled correctly.
>
> e.g.
>   A[\[:\]]
>
> should find an 'A' followed by one of '[',':',']' and it does now (old
> behavior: infinite loop).
>
> I don't seem to see any regression tests for reclass ?
>
> Also, and independent of this issue, certain regular expressions don't
> work as expected, e.g.
>    A[\[:]
> unexpectedly matches nothing, but
>    A[:\[]
> and
>    A[\[\:]
> do... ( as far as I know ':' should match itself unless one of the
> special posix ranges is used. )
>
> Review or comment would be greatly appreciated !
> Thanks,
>
imo the regrex expression is invalid, but... it seems the regrex 
parser/compiler thing ( whose code I failed to understand without 
spending lots more time on it ) doesn't handle this situation well. 
However I agree with you analysis from stepping through the code. I 
can't see it can make things worse.

would you be interested in creating some unit tests for this ? that 
would be really useful I think

Noel

ps. could you confirm license is LGPLv3+ / MPL.


More information about the LibreOffice mailing list