diff options
author | Abhijit Menon-Sen <ams@wiw.org> | 2002-04-25 19:43:06 +0000 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2002-04-25 19:43:06 +0000 |
commit | 9453426ea2cb2131d06e23614e5610b999172c9d (patch) | |
tree | 127df37aa386745ff1b37a8cfa0ef4e8f74765bc /util.c | |
parent | 38f5208578bbcb05898effe3959401ff7d2a5630 (diff) | |
download | perl-9453426ea2cb2131d06e23614e5610b999172c9d.tar.gz |
$fh->close(); print $fh "foo" would segfault under -w in
report_evil_fh() because $fh doesn't have a name.
p4raw-id: //depot/perl@16166
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3447,7 +3447,8 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op) if (gv && isGV(gv)) { SV *sv = sv_newmortal(); gv_efullname4(sv, gv, Nullch, FALSE); - name = SvPVX(sv); + if (SvOK(sv)) + name = SvPVX(sv); } if (op == OP_phoney_OUTPUT_ONLY || op == OP_phoney_INPUT_ONLY) { |