⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.177
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
.cpan
/
build
/
YAML-LibYAML-0.89-0
/
t
/
View File Name :
leak.t
use FindBin '$Bin'; use lib $Bin; use TestYAMLTests tests => ( 3 * ( 5 * 5 + 3 ) ); $YAML::XS::LoadBlessed = 1; use Scalar::Util qw(weaken); for ( 1 .. 3 ) { foreach my $case ( sub { "foo" }, sub { bless { foo => "bar" }, "Class" }, sub { [ 1 .. 3 ] }, sub { my $x = "foo"; \$x; }, sub { my $y = 42; my $x = \$y; \$x }, sub { my $h = {}; [ $h, $h ] }, #sub { my $glob = gensym(); *$glob = { foo => "bar" }; \$glob }, #sub { sub { "foo " . $_[0] } }, #sub { sub () { 3 } }, ) { my $obj = $case->(); my $yaml = Dump($obj); ok( $yaml, "dumped" ); my $loaded = Load($yaml); is( ref($loaded), ref($obj), "loaded $loaded from $obj" ); is_deeply( $loaded, $obj, "eq deeply" ); if ( ref $obj ) { weaken($obj); weaken($loaded); is( $obj, undef, "dumped object not leaked" ); is( $loaded, undef, "loaded object not leaked" ); } } }