diff options
author | Father Chrysostomos <sprout@cpan.org> | 2017-07-28 08:13:06 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2017-07-28 08:13:21 +0100 |
commit | 6035f919de13f70b44763ca492202f747d2c2758 (patch) | |
tree | e4e9c6050907c7881146c3ac439a573c6c940f50 /pp_ctl.c | |
parent | b94bb58ebced3c5efc16addcc8f60c26ffd5cccb (diff) | |
download | perl-6035f919de13f70b44763ca492202f747d2c2758.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.
(cherry picked from commit 08f800f8519574aea9e744ff83230fb93772652b)
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3678,8 +3678,8 @@ PP(pp_require) 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"); |