diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-11 11:15:27 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-12 01:53:25 -0700 |
commit | 90b0dc0e2e44e9b8e3b9054e94bdb7d4eee1b763 (patch) | |
tree | c34bbcd62b91b7a198d5e8a7909cfc95ea2c3656 /cpan/Devel-PPPort | |
parent | e4e607196cc89ddd00ce7ee29459a71f1aad42cd (diff) | |
download | perl-90b0dc0e2e44e9b8e3b9054e94bdb7d4eee1b763.tar.gz |
Devel::PPPort: force string when testing SvPV_renew
Otherwise we could be reallocating a buffer shared by another scalar.
Diffstat (limited to 'cpan/Devel-PPPort')
-rw-r--r-- | cpan/Devel-PPPort/parts/inc/SvPV | 2 | ||||
-rw-r--r-- | cpan/Devel-PPPort/t/SvPV.t | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/cpan/Devel-PPPort/parts/inc/SvPV b/cpan/Devel-PPPort/parts/inc/SvPV index a7aace7458..4894c3c6e6 100644 --- a/cpan/Devel-PPPort/parts/inc/SvPV +++ b/cpan/Devel-PPPort/parts/inc/SvPV @@ -510,6 +510,7 @@ $mhx = 42; ok(&Devel::PPPort::SvPV_nomg_const($mhx), 2); $mhx = 42; ok(&Devel::PPPort::SvPV_nomg_const_nolen($mhx), 0); my $str = ""; +&Devel::PPPort::SvPV_force($str); my($s2, $before, $after) = &Devel::PPPort::SvPV_renew($str, 81, "x"x80); ok($str, "x"x80); ok($s2, "x"x80); @@ -517,6 +518,7 @@ ok($before < 81); ok($after, 81); $str = "x"x400; +&Devel::PPPort::SvPV_force($str); ($s2, $before, $after) = &Devel::PPPort::SvPV_renew($str, 41, "x"x40); ok($str, "x"x40); ok($s2, "x"x40); diff --git a/cpan/Devel-PPPort/t/SvPV.t b/cpan/Devel-PPPort/t/SvPV.t index 63c7d72c43..025c4614dc 100644 --- a/cpan/Devel-PPPort/t/SvPV.t +++ b/cpan/Devel-PPPort/t/SvPV.t @@ -101,6 +101,7 @@ $mhx = 42; ok(&Devel::PPPort::SvPV_nomg_const($mhx), 2); $mhx = 42; ok(&Devel::PPPort::SvPV_nomg_const_nolen($mhx), 0); my $str = ""; +&Devel::PPPort::SvPV_force($str); my($s2, $before, $after) = &Devel::PPPort::SvPV_renew($str, 81, "x"x80); ok($str, "x"x80); ok($s2, "x"x80); @@ -108,6 +109,7 @@ ok($before < 81); ok($after, 81); $str = "x"x400; +&Devel::PPPort::SvPV_force($str); ($s2, $before, $after) = &Devel::PPPort::SvPV_renew($str, 41, "x"x40); ok($str, "x"x40); ok($s2, "x"x40); |