summaryrefslogtreecommitdiff
path: root/ACE/ace/UNIX_Addr.cpp
diff options
context:
space:
mode:
authorLike Ma <likemartinma@gmail.com>2019-03-10 03:22:02 +0800
committerLike Ma <likemartinma@gmail.com>2019-03-10 03:34:31 +0800
commit8d212501ec1031d271317055b9155d7fa9d50796 (patch)
tree34e1c1e86d03010b1e5c9e340d6785ccaf6fd430 /ACE/ace/UNIX_Addr.cpp
parenta0fe8e38dc0b0097bcfd4c031495a4148bcad9ab (diff)
downloadATCD-8d212501ec1031d271317055b9155d7fa9d50796.tar.gz
Fix ACE_UNIX_Addr size.
Diffstat (limited to 'ACE/ace/UNIX_Addr.cpp')
-rw-r--r--ACE/ace/UNIX_Addr.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/ACE/ace/UNIX_Addr.cpp b/ACE/ace/UNIX_Addr.cpp
index 9ce195f5f27..460c58fc4b1 100644
--- a/ACE/ace/UNIX_Addr.cpp
+++ b/ACE/ace/UNIX_Addr.cpp
@@ -41,6 +41,10 @@ ACE_UNIX_Addr::string_to_addr (const char addr[])
{
ACE_OS::strsncpy (this->unix_addr_.sun_path, addr,
sizeof this->unix_addr_.sun_path);
+
+ this->set_size (sizeof this->unix_addr_ -
+ sizeof (this->unix_addr_.sun_path) +
+ ACE_OS::strlen (this->unix_addr_.sun_path));
return 0;
}
@@ -71,7 +75,8 @@ ACE_UNIX_Addr::dump (void) const
// Do nothing constructor.
ACE_UNIX_Addr::ACE_UNIX_Addr (void)
- : ACE_Addr (AF_UNIX, sizeof this->unix_addr_)
+ : ACE_Addr (AF_UNIX,
+ sizeof this->unix_addr_ - sizeof (this->unix_addr_.sun_path))
{
(void) ACE_OS::memset ((void *) &this->unix_addr_,
0,