develooper Front page | perl.perl5.porters | Postings from September 2016

[perl #129166] null ptr deref, segfault in Perl_pp_subtractpp.c:1894

From:
Father Chrysostomos via RT
Date:
September 12, 2016 05:10
Subject:
[perl #129166] null ptr deref, segfault in Perl_pp_subtractpp.c:1894
Message ID:
rt-4.0.24-3504-1473657004-1591.129166-15-0@perl.org
On Thu Sep 01 21:30:30 2016, sprout wrote:
> On Thu Sep 01 11:56:00 2016, dcollinsn@gmail.com wrote:
> > ./perl -e '$#a=0;0-splice@a'
> >
> > Also segfaults.
> >
> > The root cause of #129164, #129166, and #129167 is almost certainly
> > something in Perl_pp_splice when called on a zero-length array.
> 
> Not zero-length, but one with a single null entry.
> 
> >
> > $ ./perl -Ilib -MDevel::Peek -e '$#a=0; Dump(splice @a);'
> > SV = 0
> >
> > Looks like a good starting point.
> 
> I think splice needs to do the same null checks that other array
> functions do, and push &PL_sv_undef for null.

Now fixed in 92b69f6.

-- 

Father Chrysostomos


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



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