In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/df8c7dee25da69fc88678b8949166e08fb686037?hp=7b6e8075e45ebc684565efbe3ce7b70435f20c79>
- Log ----------------------------------------------------------------- commit df8c7dee25da69fc88678b8949166e08fb686037 Author: Leon Timmermans <[email protected]> Date: Sat Sep 7 08:58:18 2013 +0200 Fix segfault in filehandle duplication Previously PerlIOBase_dup didn't check if pushing the new layer succeeded before (optionally) setting the utf8 flag. This could cause segfaults-by-nullpointer. ----------------------------------------------------------------------- Summary of changes: perlio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perlio.c b/perlio.c index f7c0698..7e6ceae 100644 --- a/perlio.c +++ b/perlio.c @@ -2309,7 +2309,7 @@ PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags) if (self && self->Getarg) arg = (*self->Getarg)(aTHX_ o, param, flags); f = PerlIO_push(aTHX_ f, self, PerlIO_modestr(o,buf), arg); - if (PerlIOBase(o)->flags & PERLIO_F_UTF8) + if (f && PerlIOBase(o)->flags & PERLIO_F_UTF8) PerlIOBase(f)->flags |= PERLIO_F_UTF8; SvREFCNT_dec(arg); } -- Perl5 Master Repository
