This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #112358] Storable: Don’t create RV with no refcnt
authorFather Chrysostomos <sprout@cpan.org>
Tue, 24 Apr 2012 23:00:36 +0000 (16:00 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 21 May 2012 23:51:37 +0000 (16:51 -0700)
commit27cc3b5a047e2e329f60a8c56fd2f8204b2a626b
tree20a3af4f756399aa9ebcf5b78c5f052a7e6a4b16
parentf22549bbfa35b17fad20cb25463164fea72b9754
[perl #112358] Storable: Don’t create RV with no refcnt

Otherwise assigning to it will cause the referent to be freed, because
nothing but Storable knows that it has no reference count.

Storable.xs was creating a new RV without increasing the refe-
rence count on the referent.  It was then using it to call the
STORABLE_freeze method on the object.  Since Perl passes arguments
by reference, it was possible to unref the reference by assigning to
$_[0] within STORABLE_freeze.  That would cause the object’s reference
count to go down.
dist/Storable/Storable.xs
dist/Storable/t/blessed.t