2
0
mirror of https://github.com/boostorg/asio.git synced 2026-02-24 14:22:08 +00:00

Correct an array bounds error in the treatment of paths for UNIX domain sockets.

Fixes #2120.


[SVN r47673]
This commit is contained in:
Christopher Kohlhoff
2008-07-22 08:26:35 +00:00
parent f88787fe47
commit 2d79a40ae6

View File

@@ -149,7 +149,7 @@ public:
- offsetof(boost::asio::detail::sockaddr_un_type, sun_path);
// The path returned by the operating system may be NUL-terminated.
if (path_length_ > 0 && data_.local.sun_path[path_length_] == 0)
if (path_length_ > 0 && data_.local.sun_path[path_length_ - 1] == 0)
--path_length_;
}
}