diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-10-31 05:13:25 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-10-31 15:47:03 -0700 |
commit | 8d9dd4b93fdcb05efbddfcdc0ca729324cfb60c6 (patch) | |
tree | 943dd2807bb609ab7239fc7015512995d42cf39c /pp.c | |
parent | 6f80f2fde68ead297fd758a9077e77783f96196d (diff) | |
download | perl-8d9dd4b93fdcb05efbddfcdc0ca729324cfb60c6.tar.gz |
[perl #119809] Disallow bless($ref, $tied_ref)
There is no reason tied (or otherwise magical variables like $/)
should be exempt from the ‘Attempt to bless into a reference’ error.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -616,9 +616,10 @@ PP(pp_bless) const char *ptr; if (!ssv) goto curstash; - if (!SvGMAGICAL(ssv) && !SvAMAGIC(ssv) && SvROK(ssv)) + SvGETMAGIC(ssv); + if (!SvAMAGIC(ssv) && SvROK(ssv)) Perl_croak(aTHX_ "Attempt to bless into a reference"); - ptr = SvPV_const(ssv,len); + ptr = SvPV_nomg_const(ssv,len); if (len == 0) Perl_ck_warner(aTHX_ packWARN(WARN_MISC), "Explicit blessing to '' (assuming package main)"); |