[win32] merge another maint patch
authorGurusamy Sarathy <gsar@cpan.org>
Tue, 10 Feb 1998 18:49:00 +0000 (13:49 -0500)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 12 Feb 1998 03:20:55 +0000 (03:20 +0000)
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

pp_ctl.c

index e5ddebe..2cfe854 100644 (file)
--- 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;