From: Jarkko Hietaniemi Date: Tue, 30 Apr 2002 12:32:27 +0000 (+0000) Subject: Dodge a NULL pointer dereference in cleanup of Class::DBI X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=edc2eac33c792d54399e570820645265bcb07080;p=p5sagit%2Fp5-mst-13.2.git Dodge a NULL pointer dereference in cleanup of Class::DBI 0.86's t/04-lazy.t, caught by Tatsuhiko Miyagawa. p4raw-id: //depot/perl@16277 --- diff --git a/util.c b/util.c index 1c40d46..a5b9c9b 100644 --- a/util.c +++ b/util.c @@ -1109,13 +1109,15 @@ Perl_vmess(pTHX_ const char *pat, va_list *args) if (CopLINE(cop)) Perl_sv_catpvf(aTHX_ sv, " at %s line %"IVdf, OutCopFILE(cop), (IV)CopLINE(cop)); - if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) { + if (GvIO(PL_last_in_gv) && GvGP(PL_last_in_gv) && + IoLINES(GvIOp(PL_last_in_gv))) { bool line_mode = (RsSIMPLE(PL_rs) && SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n'); Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %"IVdf, - PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv), - line_mode ? "line" : "chunk", - (IV)IoLINES(GvIOp(PL_last_in_gv))); + PL_last_in_gv == PL_argvgv ? + "" : GvNAME(PL_last_in_gv), + line_mode ? "line" : "chunk", + (IV)IoLINES(GvIOp(PL_last_in_gv))); } #ifdef USE_5005THREADS if (thr->tid)