summaryrefslogtreecommitdiff
path: root/lib/version.t
diff options
context:
space:
mode:
authorDavid Golden <dagolden@cpan.org>2010-10-08 11:39:52 -0400
committerDavid Golden <dagolden@cpan.org>2010-10-08 11:53:20 -0400
commit5de8bffdbc0d73b6750568e36033f7168cd88f51 (patch)
treea67b09b9ffcf76a37d90caf843615285c6c33690 /lib/version.t
parente771aaa95f65a9c44af94b9391ba49f4fcbfda43 (diff)
downloadperl-5de8bffdbc0d73b6750568e36033f7168cd88f51.tar.gz
Change vverify() to return HV or NULL (RT#78286)
Multiple code paths were dereferencing version objects without checking the underlying type, which could result in segmentation faults per RT#78286 This patch consolidates all dereferencing into vverify() and has vverify return the underlying HV or NULL instead of a boolean value.
Diffstat (limited to 'lib/version.t')
-rw-r--r--lib/version.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/version.t b/lib/version.t
index 7bce0ebbd9..da7a5fda07 100644
--- a/lib/version.t
+++ b/lib/version.t
@@ -96,9 +96,15 @@ like($@, qr/Invalid version object/,
eval { my $test = ($testobj > 1.0) };
like($@, qr/Invalid version object/,
"Bad subclass vcmp");
-strict_lax_tests();
+
+# Invalid structure
+eval { $a = \\version->new(1); bless $a, "version"; print "# $a\n" };
+like($@, qr/Invalid version object/,
+ "Bad internal structure (RT#78286)");
# do strict lax tests in a sub to isolate a package to test importing
+strict_lax_tests();
+
sub strict_lax_tests {
package temp12345;
# copied from perl core test t/op/packagev.t