Re: [pcre-dev] MARK value can't pass through atomic group bo…

Etusivu
Poista viesti
Lähettäjä: Philip Hazel
Päiväys:  
Vastaanottaja: ND
Kopio: Pcre-dev@exim.org
Aihe: Re: [pcre-dev] MARK value can't pass through atomic group borders
On Mon, 7 Nov 2011, ND wrote:

> I'm try to implement PCRE 8.20 into my application and gets a critical bug. I
> found that because MARK value can't pass through atomic group borders and not
> returned from pcre_exec().
>
> Here is pcretest.exe listing:
>
> PCRE version 8.20 2011-10-21
> /(?>a(*:m))/imsxSK
> a
> 0: a
>
> Expected:
> MK: m
>
>
> Is there a possibility to make a hotfix?


This appears to have been introduced by change 18 for 8.20. Here's a
trivial patch:

===================================================================
--- pcre_exec.c (revision 742)
+++ pcre_exec.c (working copy)
@@ -816,6 +816,7 @@
       if (rrc == MATCH_MATCH)  /* Note: _not_ MATCH_ACCEPT */
         {
         mstart = md->start_match_ptr;
+        markptr = md->mark;
         break;
         }
       if (rrc == MATCH_THEN)
===================================================================


This case is now in the tests, so it shouldn't happen again.

Philip

--
Philip Hazel