Subject: [Boost-bugs] [Boost C++ Libraries] #8752: Bad check for invalid socket in boost::asio::detail::win_iocp_socket_service<Protocol>::accept()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-07-01 17:26:17
#8752: Bad check for invalid socket in
boost::asio::detail::win_iocp_socket_service<Protocol>::accept()
------------------------------+----------------------------
Reporter: Kevin.Vlack@⦠| Owner: chris_kohlhoff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
Version: Boost 1.53.0 | Severity: Problem
Keywords: |
------------------------------+----------------------------
(See line 434 in boost/asio/detail/win_iocp_socket_service.hpp).
At the end of the function
boost::asio::detail::win_iocp_socket_service<Protocol>::accept() there is
a check for an valid SOCKET handle by checking if the result is >= 0.
In recent Winsock implementations the SOCKET is typedef'd as an unsigned
type (UINT_PTR), so this check for >= 0 will succeed even for invalid
sockets.
If the preceding accept() operation fails and returns an invalid socket,
the consequence of using it in subsequent operations is an ugly anonymous
exception.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8752> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC