develooper Front page | perl.perl5.porters | Postings from October 2011

Re: [perl #94560] [PATCH v5.12.4-1-gea42574] large repeat count causesheap corruption

Thread Previous
Vincent Pit
October 23, 2011 14:21
Re: [perl #94560] [PATCH v5.12.4-1-gea42574] large repeat count causesheap corruption
Message ID:

>> As for fixing it, I've included a patch that works for me, but it's
>> probably not so simple.  I doubt you can so easily change a public API
>> like Perl_repeatcpy, even if it's so fundamentally limited.
> I’m no C expert, but if IV is bigger than I32, then isn’t it OK to
> change the signature? It won’t be binary-compatible (which 5.16 won’t be
> anyway), but it should be source-compatible, shouldn’t it?

I believe it could cause some conversion warnings when extra flags are 
passed to the compiler (like -Wconversion), but I think it is fair in 
this case. Note that Perl_repeatcpy() is also called in regcomp.c with 
an int as the last argument, so if a smoker sets that flag we'll see the 
warning soon.

> In other words: Can other perl porters tell me whether this patch can be
> applied as-is?

This is easy : no, it can't. The prototype of Perl_repeatcpy should be 
changed in embed.fnc, and then the headers can be regenerated.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About