From: Gurusamy Sarathy Date: Tue, 10 Feb 1998 18:49:00 +0000 (-0500) Subject: [win32] merge another maint patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6132ea6cb008000f686569237d7bd960bbd9703f;p=p5sagit%2Fp5-mst-13.2.git [win32] merge another maint patch Message-Id: <199802102349.SAA16001@aatma.engin.umich.edu> Subject: Re: after an eval-ed bad require, requiring a string ref gives a SEGV p4raw-id: //depot/win32/perl@500 --- diff --git a/pp_ctl.c b/pp_ctl.c index e5ddebe..2cfe854 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2348,6 +2348,7 @@ PP(pp_require) register PERL_CONTEXT *cx; SV *sv; char *name; + STRLEN len; char *tryname; SV *namesv = Nullsv; SV** svp; @@ -2362,12 +2363,12 @@ PP(pp_require) SvPV(sv,na),patchlevel); RETPUSHYES; } - name = SvPV(sv, na); - if (!*name) + name = SvPV(sv, len); + if (!(name && len > 0 && *name)) DIE("Null filename used"); TAINT_PROPER("require"); if (op->op_type == OP_REQUIRE && - (svp = hv_fetch(GvHVn(incgv), name, SvCUR(sv), 0)) && + (svp = hv_fetch(GvHVn(incgv), name, len, 0)) && *svp != &sv_undef) RETPUSHYES;