summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp')
-rw-r--r--3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp5
1 files changed, 3 insertions, 2 deletions
diff --git a/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp b/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp
index 1a66fb95665..6a1124a791a 100644
--- a/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp
+++ b/3rdparty/asio/include/asio/generic/detail/impl/endpoint.ipp
@@ -2,7 +2,7 @@
// generic/detail/impl/endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -94,7 +94,8 @@ void endpoint::init(const void* sock_addr,
using namespace std; // For memset and memcpy.
memset(&data_.generic, 0, sizeof(asio::detail::sockaddr_storage_type));
- memcpy(&data_.generic, sock_addr, sock_addr_size);
+ if (sock_addr_size > 0)
+ memcpy(&data_.generic, sock_addr, sock_addr_size);
size_ = sock_addr_size;
protocol_ = sock_protocol;