summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorStas Bekman <stas@stason.org>2001-12-12 00:17:55 +0800
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-11 13:51:21 +0000
commit53f1b6d26c38bb28847eb6095c762cac3e79dd5a (patch)
tree3c14200f638d331ae665bdfc16b476420cc6eb60 /perlio.c
parent4a9f028cfd0d4a71625e6d371deefaa0edd0b19a (diff)
downloadperl-53f1b6d26c38bb28847eb6095c762cac3e79dd5a.tar.gz
[patch perlio.c] test for NULL before derefencing
Message-ID: <3C15C133.8@stason.org> p4raw-id: //depot/perl@13619
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/perlio.c b/perlio.c
index bdbde16d44..1fab7b7aa4 100644
--- a/perlio.c
+++ b/perlio.c
@@ -968,7 +968,7 @@ PerlIO_push(pTHX_ PerlIO *f, PerlIO_funcs *tab, const char *mode, SV *arg)
{
PerlIOl *l = NULL;
Newc('L',l,tab->size,char,PerlIOl);
- if (l) {
+ if (l && f) {
Zero(l, tab->size, char);
l->next = *f;
l->tab = tab;
@@ -1052,7 +1052,7 @@ int
PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, const char *names)
{
int code = 0;
- if (names) {
+ if (f && names) {
PerlIO_list_t *layers = PerlIO_list_alloc(aTHX);
code = PerlIO_parse_layers(aTHX_ layers, names);
if (code == 0) {