From: Rafael Garcia-Suarez Date: Wed, 4 Jun 2003 18:53:48 +0000 (+0000) Subject: Prevent a potential null pointer dereference. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f75cc58fe629e987cf6dc51251c428b28753131;p=p5sagit%2Fp5-mst-13.2.git Prevent a potential null pointer dereference. Noticed by Ryan Koga in Message-ID: p4raw-id: //depot/perl@19688 --- diff --git a/perlio.c b/perlio.c index dcd2f66..91db1e1 100644 --- a/perlio.c +++ b/perlio.c @@ -3323,10 +3323,11 @@ PerlIO_exportFILE(PerlIO * f, const char *mode) stdio = PerlSIO_fdopen(PerlIO_fileno(f), mode); if (stdio) { PerlIOl *l = *f; + PerlIO *f2; /* De-link any lower layers so new :stdio sticks */ *f = NULL; - if ((f = PerlIO_push(aTHX_ f, &PerlIO_stdio, buf, Nullsv))) { - PerlIOStdio *s = PerlIOSelf(f, PerlIOStdio); + if ((f2 = PerlIO_push(aTHX_ f, &PerlIO_stdio, buf, Nullsv))) { + PerlIOStdio *s = PerlIOSelf((f = f2), PerlIOStdio); s->stdio = stdio; /* Link previous lower layers under new one */ *PerlIONext(f) = l;