diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-06-07 23:56:23 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-06-08 00:14:12 -0700 |
commit | dcdfe746ecfff81cc2793db4e7fdfe25be590e0b (patch) | |
tree | 3e7cdc9e93e36dc56dbe2306185d06e5e89c7cf1 /pp.c | |
parent | 94e7eb6fe4b29b1c1dbe5eb489b4bfae607d9350 (diff) | |
download | perl-dcdfe746ecfff81cc2793db4e7fdfe25be590e0b.tar.gz |
[perl #117941] Blessing into freed current stash
If the current stash has been freed, bless() with one argument will
cause a crash when the object’s ‘stash’ is accessed. Simply disallow-
ing this is the easiest fix.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -607,8 +607,12 @@ PP(pp_bless) HV *stash; if (MAXARG == 1) + { curstash: stash = CopSTASH(PL_curcop); + if (SvTYPE(stash) != SVt_PVHV) + Perl_croak(aTHX_ "Attempt to bless into a freed package"); + } else { SV * const ssv = POPs; STRLEN len; |