diff options
author | Ricardo Signes <rjbs@cpan.org> | 2013-01-16 09:36:47 -0500 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2013-01-16 09:36:49 -0500 |
commit | 90ae46a10a094e68135385e525c78962d6572da3 (patch) | |
tree | c6160b9a6be0dbaf47dc9eee7429bae0c6589c1b /cpan/Socket | |
parent | c52f983f3d907e1a64412b732bc302b3e6c5f41f (diff) | |
download | perl-90ae46a10a094e68135385e525c78962d6572da3.tar.gz |
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)
Diffstat (limited to 'cpan/Socket')
-rw-r--r-- | cpan/Socket/Makefile.PL | 2 | ||||
-rw-r--r-- | cpan/Socket/Socket.pm | 2 | ||||
-rw-r--r-- | 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 639a57c4d6..99114d272e 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 a3a38d9f81..acc7bfcb23 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 4bfaada2f1..069043531f 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))); |