Boost C++ Libraries: Ticket #2120: Asio local domain sockets crop senders abstract path name. https://svn.boost.org/trac10/ticket/2120 <p> I'm experiencing that, when using abstract socket names with <a class="missing wiki">Asio/Local</a>, the last character in the senders path name gets cropped. </p> <p> The senders full path name is received by reactive_socket_service::receive_operation::receive_from, but after the receive action, a resize function is called on the endpoint object. The basic_endpoint::resize then calculates the path length to be one character to few. </p> <pre class="wiki"> /// Set the underlying size of the endpoint in the native type. void basic_endpoint::resize(std::size_t size) { if (size &gt; sizeof(boost::asio::detail::sockaddr_un_type)) { boost::system::system_error e(boost::asio::error::invalid_argument); boost::throw_exception(e); } else if (size == 0) { path_length_ = 0; } else { path_length_ = size - offsetof(boost::asio::detail::sockaddr_un_type, sun_path); // The path returned by the operating system may be NUL-terminated. if (path_length_ &gt; 0 &amp;&amp; data_.local.sun_path[path_length_] == 0) --path_length_; } } </pre><p> I guess the last part should have been </p> <pre class="wiki"> if (path_length_ &gt; 0 &amp;&amp; data_.local.sun_path[path_length_-1] == 0) --path_length_; </pre><p> Btw. if using non-abstract names the name is not cropped, but indexing past the path name terminating character can be observed when adjusting path length. Changing the zero termination indexing makes both abstract and non-abstract names pass unaltered... </p> <p> br/thanx Jan </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2120 Trac 1.4.3 chris_kohlhoff Mon, 21 Jul 2008 23:51:17 GMT status, milestone changed https://svn.boost.org/trac10/ticket/2120#comment:1 https://svn.boost.org/trac10/ticket/2120#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.35.1</span> → <span class="trac-field-new">Boost 1.36.0</span> </li> </ul> Ticket chris_kohlhoff Tue, 22 Jul 2008 08:26:37 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2120#comment:2 https://svn.boost.org/trac10/ticket/2120#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/47673" title="Correct an array bounds error in the treatment of paths for UNIX ...">[47673]</a>) Correct an array bounds error in the treatment of paths for UNIX domain sockets. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2120" title="#2120: Bugs: Asio local domain sockets crop senders abstract path name. (closed: fixed)">#2120</a>. </p> Ticket chris_kohlhoff Tue, 22 Jul 2008 08:30:39 GMT <link>https://svn.boost.org/trac10/ticket/2120#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2120#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/47674" title="Merged revisions 47673 via svnmerge from ...">[47674]</a>) Merged revisions 47673 via svnmerge from <a class="ext-link" href="https://svn.boost.org/svn/boost/trunk"><span class="icon">​</span>https://svn.boost.org/svn/boost/trunk</a> </p> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/47673" title="Correct an array bounds error in the treatment of paths for UNIX ...">r47673</a> | chris_kohlhoff | 2008-07-22 18:26:35 +1000 (Tue, 22 Jul 2008) | 3 lines </p> </blockquote> <p> </p> <blockquote> <p> Correct an array bounds error in the treatment of paths for UNIX domain sockets. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2120" title="#2120: Bugs: Asio local domain sockets crop senders abstract path name. (closed: fixed)">#2120</a>. </p> </blockquote> <p> ........ </p> </description> <category>Ticket</category> </item> </channel> </rss>