summaryrefslogtreecommitdiff
path: root/boost/asio/local/detail
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/local/detail')
-rw-r--r--boost/asio/local/detail/impl/endpoint.ipp3
1 files changed, 2 insertions, 1 deletions
diff --git a/boost/asio/local/detail/impl/endpoint.ipp b/boost/asio/local/detail/impl/endpoint.ipp
index 4173a8242e..d668e8badc 100644
--- a/boost/asio/local/detail/impl/endpoint.ipp
+++ b/boost/asio/local/detail/impl/endpoint.ipp
@@ -109,7 +109,8 @@ void endpoint::init(const char* path_name, std::size_t path_length)
using namespace std; // For memcpy.
data_.local = boost::asio::detail::sockaddr_un_type();
data_.local.sun_family = AF_UNIX;
- memcpy(data_.local.sun_path, path_name, path_length);
+ if (path_length > 0)
+ memcpy(data_.local.sun_path, path_name, path_length);
path_length_ = path_length;
// NUL-terminate normal path names. Names that start with a NUL are in the