diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-06-04 18:53:48 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-06-04 18:53:48 +0000 |
commit | 9f75cc58fe629e987cf6dc51251c428b28753131 (patch) | |
tree | bf1c32e67a694bd3a0ccab4b4765c28f790dc968 /perlio.c | |
parent | 763754f38cf4aa7529d159af680f3507268996d8 (diff) | |
download | perl-9f75cc58fe629e987cf6dc51251c428b28753131.tar.gz |
Prevent a potential null pointer dereference.
Noticed by Ryan Koga <rkoga@caida.org> in
Message-ID: <Pine.BSF.4.44.0306031659090.1489-100000@login.caida.org>
p4raw-id: //depot/perl@19688
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |