Re: [Boost-bugs] [Boost C++ Libraries] #8612: unused pointers in copying of handlers

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8612: unused pointers in copying of handlers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-24 03:14:10


#8612: unused pointers in copying of handlers
----------------------------------------------+-----------------------------
  Reporter: Richard <legalize@…> | Owner: chris_kohlhoff
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: asio
   Version: Boost 1.52.0 | Severity: Cosmetic
Resolution: | Keywords:
----------------------------------------------+-----------------------------

Comment (by Richard <legalize@…>):

 I looked at this pretty closely before opening the ticket. So far,
 Coverity has had a very low false positive on it's analysis because it
 analyzes the resulting binary as well as the source code.

 To my eyes, the sequence goes like this in reactive_socket_recv_op.hpp:
 {{{
 ptr p = { boost::addressof(o->handler_), o, o };
 // p.h == boost::addressof(o->handler_)

 BOOST_ASIO_HANDLER_COMPLETION((o));
 // p.h == boost::addressof(o->handler_)

 detail::binder2<Handler, boost::system::error_code, std::size_t>
   handler(o->handler_, o->ec_, o->bytes_transferred_);
 // p.h == boost::addressof(o->handler_)

 p.h = boost::asio::detail::addressof(handler.handler_);
 // p.h overwritten and original value discarded

 p.reset();
 // p.h used in d'tor if p.v != 0
 }}}

 All the other cases I looked at appeared to follow a similar pattern, but
 I only drilled through the exact details on this one.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8612#comment:2>
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