Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2008-07-22 04:26:35


Author: chris_kohlhoff
Date: 2008-07-22 04:26:35 EDT (Tue, 22 Jul 2008)
New Revision: 47673
URL: http://svn.boost.org/trac/boost/changeset/47673

Log:
Correct an array bounds error in the treatment of paths for UNIX domain sockets.
Fixes #2120.

Text files modified:
   trunk/boost/asio/local/basic_endpoint.hpp | 2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

Modified: trunk/boost/asio/local/basic_endpoint.hpp
==============================================================================
--- trunk/boost/asio/local/basic_endpoint.hpp (original)
+++ trunk/boost/asio/local/basic_endpoint.hpp 2008-07-22 04:26:35 EDT (Tue, 22 Jul 2008)
@@ -149,7 +149,7 @@
         - 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_;
     }
   }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk