develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #112790] Regexp engine cannot match >2GB strings

From:
Father Chrysostomos via RT
Date:
August 25, 2013 19:32
Subject:
[perl #112790] Regexp engine cannot match >2GB strings
Message ID:
rt-3.6.HEAD-29599-1377459119-172.112790-15-0@perl.org
On Sun May 06 11:19:53 2012, dgl wrote:
> Matching unexpectedly fails when the string is longer than I32. The
> following fixes it, but I see a lot of I32 in the regexp engine itself so
> this might be masking other issues (see also RT #72784).
> 
> diff --git a/pp_hot.c b/pp_hot.c
> index 89165d9..662b908 100644
> --- a/pp_hot.c
> +++ b/pp_hot.c
> @@ -1303,7 +1303,7 @@ PP(pp_match)
>         rx = PM_GETRE(pm);
>      }
> 
> -    if (RX_MINLEN(rx) > (I32)len)
> +    if ((STRLEN)RX_MINLEN(rx) > len)
>         goto failure;
> 
>      truebase = t = s;

I have gone through the regexp engine and change any uses of I32 that
hold lengths of the string being matched against.

See the commits leading up to merge commit ed56dbcb5, in particular
389ecb564 which is similar to your proposed patch.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=112790



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About