In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/90ae46a10a094e68135385e525c78962d6572da3?hp=c52f983f3d907e1a64412b732bc302b3e6c5f41f>
- Log ----------------------------------------------------------------- commit 90ae46a10a094e68135385e525c78962d6572da3 Author: Ricardo Signes <[email protected]> Date: Wed Jan 16 09:36:47 2013 -0500 Upgrade Socket to CPAN version 2.008 2012/12/27 2.008 CHANGES: * Fix uninitialised memory read (RT82119) 2012/12/16 2.007 CHANGES: * Test %Config keys for definedness, not mere existence (RT79854) * Fix missing argument in sprintf in Socket.xs (from perl.git 5d6dfea82e1c4b6, RT82007) ----------------------------------------------------------------------- Summary of changes: cpan/Socket/Makefile.PL | 2 +- cpan/Socket/Socket.pm | 2 +- cpan/Socket/Socket.xs | 16 ++++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cpan/Socket/Makefile.PL b/cpan/Socket/Makefile.PL index 639a57c..99114d2 100644 --- a/cpan/Socket/Makefile.PL +++ b/cpan/Socket/Makefile.PL @@ -13,7 +13,7 @@ my $seq = 0; sub check_for { my %args = @_; - return if exists $Config{$args{confkey}}; + return if defined $Config{$args{confkey}}; require ExtUtils::CBuilder; $cb ||= ExtUtils::CBuilder->new( quiet => 1 ); diff --git a/cpan/Socket/Socket.pm b/cpan/Socket/Socket.pm index a3a38d9..acc7bfc 100644 --- a/cpan/Socket/Socket.pm +++ b/cpan/Socket/Socket.pm @@ -3,7 +3,7 @@ package Socket; use strict; { use 5.006001; } -our $VERSION = '2.006_001'; +our $VERSION = '2.008'; =head1 NAME diff --git a/cpan/Socket/Socket.xs b/cpan/Socket/Socket.xs index 4bfaada..0690435 100644 --- a/cpan/Socket/Socket.xs +++ b/cpan/Socket/Socket.xs @@ -895,7 +895,7 @@ inet_ntop(af, ip_address_sv) SV * ip_address_sv CODE: #ifdef HAS_INETNTOP - STRLEN addrlen, struct_size; + STRLEN addrlen; #ifdef AF_INET6 struct in6_addr addr; char str[INET6_ADDRSTRLEN]; @@ -910,19 +910,17 @@ inet_ntop(af, ip_address_sv) ip_address = SvPV(ip_address_sv, addrlen); - struct_size = sizeof(addr); - switch(af) { case AF_INET: if(addrlen != 4) croak("Bad address length for Socket::inet_ntop on AF_INET;" - " got %d, should be 4", addrlen); + " got %"UVuf", should be 4", (UV)addrlen); break; #ifdef AF_INET6 case AF_INET6: if(addrlen != 16) croak("Bad address length for Socket::inet_ntop on AF_INET6;" - " got %d, should be 16", addrlen); + " got %"UVuf", should be 16", (UV)addrlen); break; #endif default: @@ -935,7 +933,13 @@ inet_ntop(af, ip_address_sv) "Socket::inet_ntop", af); } - Copy(ip_address, &addr, sizeof addr, char); + if(addrlen < sizeof(addr)) { + Copy(ip_address, &addr, addrlen, char); + Zero(((char*)&addr) + addrlen, sizeof(addr) - addrlen, char); + } + else { + Copy(ip_address, &addr, sizeof addr, char); + } inet_ntop(af, &addr, str, sizeof str); ST(0) = sv_2mortal(newSVpvn(str, strlen(str))); -- Perl5 Master Repository
