diff options
author | Tony Cook <tony@develop-help.com> | 2012-05-15 19:22:30 +1000 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2012-05-15 17:35:13 -0400 |
commit | 2329674809a320420acae0efb5641e1800297583 (patch) | |
tree | e43ae15034f179a7b35ec9c5fbe8533e7b978814 /cpan/Socket | |
parent | 14b32ddab61902a15395daf29abf756e972cec84 (diff) | |
download | perl-2329674809a320420acae0efb5641e1800297583.tar.gz |
Update Socket to CPAN version 2.001
2.001 CHANGES:
* Apply (modified) patch from ppisar@redhat.com to fix memory
addressing bug with Zero() - RT76067
* Document that inet_pton() doesn't work on hostnames, only textual
addresses - RT76010
* Ignore any existing-but-undefined hints hash members to
getaddrinfo()
Done for the critical RT76067 fix.
Diffstat (limited to 'cpan/Socket')
-rw-r--r-- | cpan/Socket/Socket.pm | 4 | ||||
-rw-r--r-- | cpan/Socket/Socket.xs | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cpan/Socket/Socket.pm b/cpan/Socket/Socket.pm index 3b8ea73eed..e12d8517de 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.000'; +our $VERSION = '2.001'; =head1 NAME @@ -286,7 +286,7 @@ code should use getnameinfo() or inet_ntop() instead for IPv6 support. =head2 $address = inet_pton $family, $string Takes an address family (such as C<AF_INET> or C<AF_INET6>) and a string -giving the name of a host, or a textual representation of an IP address and +containing a textual representation of an address in that family and translates that to an packed binary address structure. See also getaddrinfo() for a more powerful and flexible function to look up diff --git a/cpan/Socket/Socket.xs b/cpan/Socket/Socket.xs index 3999c4b7ce..5ddd0e9d8e 100644 --- a/cpan/Socket/Socket.xs +++ b/cpan/Socket/Socket.xs @@ -444,13 +444,13 @@ static void xs_getaddrinfo(pTHX_ CV *cv) hintshash = (HV*)SvRV(hints); - if((valp = hv_fetch(hintshash, "flags", 5, 0)) != NULL) + if((valp = hv_fetch(hintshash, "flags", 5, 0)) != NULL && SvOK(*valp)) hints_s.ai_flags = SvIV(*valp); - if((valp = hv_fetch(hintshash, "family", 6, 0)) != NULL) + if((valp = hv_fetch(hintshash, "family", 6, 0)) != NULL && SvOK(*valp)) hints_s.ai_family = SvIV(*valp); - if((valp = hv_fetch(hintshash, "socktype", 8, 0)) != NULL) + if((valp = hv_fetch(hintshash, "socktype", 8, 0)) != NULL && SvOK(*valp)) hints_s.ai_socktype = SvIV(*valp); - if((valp = hv_fetch(hintshash, "protocol", 8, 0)) != NULL) + if((valp = hv_fetch(hintshash, "protocol", 8, 0)) != NULL && SvOK(*valp)) hints_s.ai_protocol = SvIV(*valp); } @@ -712,7 +712,7 @@ unpack_sockaddr_un(sun_sv) getpeername and getsockname is not equal to sizeof(addr). */ if (sockaddrlen < sizeof(addr)) { Copy(sun_ad, &addr, sockaddrlen, char); - Zero(&addr+sockaddrlen, sizeof(addr)-sockaddrlen, char); + Zero(((char*)&addr) + sockaddrlen, sizeof(addr) - sockaddrlen, char); } else { Copy(sun_ad, &addr, sizeof(addr), char); } |