This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #118551) an empty string from _freeze() now supplies the same to _thaw()/_attach()
authorTony Cook <tony@develop-help.com>
Wed, 6 Dec 2017 00:52:20 +0000 (01:52 +0100)
committerTony Cook <tony@develop-help.com>
Thu, 8 Feb 2018 02:58:13 +0000 (13:58 +1100)
commit48968138d19790da77fff757c57f19594b144e11
treee0376e6507522684d47ecaff9a0ed3df0938c4e8
parenta63d7bdb6c975ff2bb549b1f6724b604fc6ee175
(perl #118551) an empty string from _freeze() now supplies the same to _thaw()/_attach()

The retrieve_hook() code would simply pass the string length to
NEWSV(), so if the length was zero, no PV would be allocated, and the
SV would not be upgraded.

The following code would then set POK on an SV that wasn't SVt_PV (or
better), resulting in fun later down the line.

Change to always supply at least 1 as the buffer size for NEWSV(), and
always set CUR and NUL terminate the buffer.
dist/Storable/Storable.xs
dist/Storable/t/blessed.t