diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-23 20:26:51 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-24 01:45:30 -0800 |
commit | e37d6bdb385bdcf32a72bdde366106ee4c503bfe (patch) | |
tree | e822a49d3102560178721d892a61d7d25a4b0b03 /sv.c | |
parent | 9d6d5a7950f47e97191ed3cc7a45cd5b06163193 (diff) | |
download | perl-e37d6bdb385bdcf32a72bdde366106ee4c503bfe.tar.gz |
sysread should not ignore magic on its buffer
sysread uses SvPV_force, which has a bug in it. Even if the SV_GMAGIC
flag is passed to sv_pvn_force_flags (which SvPV_force does), it
ignores magic in any typeglob argument.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -9014,6 +9014,7 @@ Perl_sv_pvn_force_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags) PERL_ARGS_ASSERT_SV_PVN_FORCE_FLAGS; + if (flags & SV_GMAGIC) SvGETMAGIC(sv); if (SvTHINKFIRST(sv) && !SvROK(sv)) sv_force_normal_flags(sv, 0); @@ -9038,7 +9039,7 @@ Perl_sv_pvn_force_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags) /* diag_listed_as: Can't coerce %s to %s in %s */ Perl_croak(aTHX_ "Can't coerce %s to string in %s", sv_reftype(sv,0), OP_DESC(PL_op)); - s = sv_2pv_flags(sv, &len, flags); + s = sv_2pv_flags(sv, &len, flags &~ SV_GMAGIC); if (lp) *lp = len; |