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:
@@ -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_;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user