From ac98b3872fc737300c207bf3bc50b05f5bb2088f Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Wed, 10 Mar 2004 16:44:24 +0000 Subject: ChangeLogTag:Wed Mar 10 11:39:41 2004 Steve Huston --- ace/INET_Addr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ace/INET_Addr.cpp') diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index b95b67fffeb..62f6215d5e7 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -476,6 +476,9 @@ ACE_INET_Addr::set (const sockaddr_in *addr, int len) if (addr->sin_family == AF_INET) { + int maxlen = ACE_static_cast (int, sizeof (this->inet_addr_.in4_)); + if (len > maxlen) + len = maxlen; ACE_OS::memcpy (&this->inet_addr_.in4_, addr, len); this->base_set (AF_INET, len); return 0; @@ -483,6 +486,9 @@ ACE_INET_Addr::set (const sockaddr_in *addr, int len) #if defined (ACE_HAS_IPV6) else if (addr->sin_family == AF_INET6) { + int maxlen = ACE_static_cast (int, sizeof (this->inet_addr_.in6_)); + if (len > maxlen) + len = maxlen; ACE_OS::memcpy (&this->inet_addr_.in6_, addr, len); this->base_set (AF_INET6, len); return 0; -- cgit v1.2.1