develooper Front page | perl.perl5.porters | Postings from February 2018

Re: [perl #132892] Possibly memory leak when matching strings usingpre-compiled regexes stored in hash key (perl >= v5.26)

Thread Previous | Thread Next
From:
demerphq
Date:
February 23, 2018 09:34
Subject:
Re: [perl #132892] Possibly memory leak when matching strings usingpre-compiled regexes stored in hash key (perl >= v5.26)
Message ID:
CANgJU+V60PxWJsxtskTjOhOGh8zLHCBcbLLY=u_1Wv=nJGbPeA@mail.gmail.com
On 23 February 2018 at 04:27, demerphq <demerphq@gmail.com> wrote:
> On 22 February 2018 at 12:29, Sergey Aleynikov via RT
> <perlbug-followup@perl.org> wrote:
>> Bisect points to commit b10cb25a6c86fd96fff8f2dfa6d8df3e6b51a451
>> Author: Yves Orton <demerphq@gmail.com>
>> Date:   Sat Sep 17 20:14:53 2016 +0200
>>
>>     regcomp.c: S_concat_pat: guard against missing trailing nulls
>>
>>     The regex engine expects the pattern to have a null byte at
>>     SvEND(pat), but is not guaranteed to receive such a pattern
>>     when it is called, so S_concat_pat should guard against this
>>     case. It turns out this is only an issue when there is exactly
>>     one "argument" to the pattern. (Consider concatenation rules, etc).
>
> Thanks, I forgot an sv_2mortal in that patch, I will push a fix soon.
>
> Much obliged for the bisect!

Fixed in 910a6a8be166fb3780dcd2520e3526e537383ef2

Unfortunately I don't know how to test for a memory leak, so no tests included.

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


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