summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-02-10 13:49:00 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-02-12 03:20:55 +0000
commit6132ea6cb008000f686569237d7bd960bbd9703f (patch)
treea3470923a1996be841e0801c173ce26db48f204f /pp_ctl.c
parentcd7e6f2a049a2bf9126cadb5505af22bdaf4d526 (diff)
downloadperl-6132ea6cb008000f686569237d7bd960bbd9703f.tar.gz
[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
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index e5ddebefd1..2cfe854893 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;