diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-05-18 18:07:37 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-05-18 20:13:57 -0700 |
commit | 08f800f8519574aea9e744ff83230fb93772652b (patch) | |
tree | 26ed553fdf1e06d508df81704876551c31b10ba9 /pp_ctl.c | |
parent | 482e4418cbff3a580fd0c63dd1918d375a086700 (diff) | |
download | perl-08f800f8519574aea9e744ff83230fb93772652b.tar.gz |
[perl #128182] Fix crash with require $nonstring
If something other than a plain string (e.g. a reference or typeglob)
whose stringified form contains a null character is passed to require()
or do(), it crashes, as of v5.19.3-130-gc8028aa, because the code in
question that handles the error tries to read fields of the scalar
that are only valid if it is a string internally.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3686,8 +3686,8 @@ S_require_file(pTHX_ SV *const sv) if (!IS_SAFE_PATHNAME(name, len, "require")) { DIE(aTHX_ "Can't locate %s: %s", - pv_escape(newSVpvs_flags("",SVs_TEMP),SvPVX(sv),SvCUR(sv), - SvCUR(sv)*2,NULL, SvUTF8(sv)?PERL_PV_ESCAPE_UNI:0), + pv_escape(newSVpvs_flags("",SVs_TEMP),name,len,len*2, + NULL, SvUTF8(sv)?PERL_PV_ESCAPE_UNI:0), Strerror(ENOENT)); } TAINT_PROPER("require"); |