summaryrefslogtreecommitdiff
path: root/cpan/Socket
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-01-18 16:54:50 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-01-18 16:54:50 +0000
commit5b05192fea0c4ca81a055932c9efddaa78e85484 (patch)
treec35a058ea29db9236dbca8721b664c282578e842 /cpan/Socket
parentaef6dd01c82b1066ab5442eedbf3627480dc984f (diff)
downloadperl-5b05192fea0c4ca81a055932c9efddaa78e85484.tar.gz
Update Socket to CPAN version 2.009
[DELTA] 2013/01/18 2.009 CHANGES: * Fix building in core by skipping check_for() as it doesn't work there (RT82760) 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.PL3
-rw-r--r--cpan/Socket/Socket.pm2
-rw-r--r--cpan/Socket/Socket.xs16
3 files changed, 13 insertions, 8 deletions
diff --git a/cpan/Socket/Makefile.PL b/cpan/Socket/Makefile.PL
index 639a57c4d6..117d7782b4 100644
--- a/cpan/Socket/Makefile.PL
+++ b/cpan/Socket/Makefile.PL
@@ -13,7 +13,8 @@ my $seq = 0;
sub check_for
{
my %args = @_;
- return if exists $Config{$args{confkey}};
+ return if $ENV{PERL_CORE};
+ 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..270e4ed14d 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.009';
=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)));