develooper Front page | perl.perl5.porters | Postings from May 2015

[perl #124187] null ptr deref -> S_pad_findlex (pad.c:1141

Thread Next
From:
Tony Cook via RT
Date:
May 5, 2015 06:52
Subject:
[perl #124187] null ptr deref -> S_pad_findlex (pad.c:1141
Message ID:
rt-4.0.18-24049-1430808716-111.124187-15-0@perl.org
On Mon Apr 27 18:03:33 2015, tonyc wrote:
> On Mon Apr 27 15:21:58 2015, rjbs wrote:
> > On Tue Apr 21 22:03:33 2015, tonyc wrote:
> > > The attached prevents the crash.
> > >
> > > There maybe a deeper issue where PL_compcv isn't being restored
> > > correctly.
> > 
> > Are we (read: you) comfortable with this patch as the way to sort this
> > out?  Is your concern that this will paper over one symptom but leave
> > a deeper problem still ready to spring, or is that an unrelated
> > observation?
> 
> Yes, that's my concern.
> 
> I haven't worked with the parser enough to know whether PL_compcv == NULL
> is a normal case.

These also crash in S_pad_findlex(), with different backtraces:

qq{@{[{}}*sub{]]}}}=<$foo>

qq{@{[{}}*sub{]]}}}; foo()

In all three cases, PP_compcv == PL_main_cv and there's no sensible value to 
replace into PL_compcv.

I tried changing the code from 9ffcdca1 to leave PL_compcv if it's PL_main_cv,
but that resulted in later assertion failures.

I've pushed my original patch from above to blead, since no-one has objected
to it.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=124187

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