[Boost-bugs] [Boost C++ Libraries] #9777: signals2 null shared_ptr dereference

Subject: [Boost-bugs] [Boost C++ Libraries] #9777: signals2 null shared_ptr dereference
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-14 21:08:36


#9777: signals2 null shared_ptr dereference
------------------------------+----------------------
 Reporter: dkomisar@… | Owner: fmhess
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: signals2
  Version: Boost 1.46.1 | Severity: Problem
 Keywords: |
------------------------------+----------------------
 I've checked that this still in trunk but I didn't check to see if
 anything else had changed.

 signals2/detail/signal_template.hpp line 490 in 1.46.1:
 {{{
 // if the connection list passed in as a parameter is no longer in use,
 // we don't need to do any cleanup.
 if(&_shared_state->connection_bodies() != connection_bodies)
 {
    return;
 }
 }}}

 connection_bodies returns a reference which is a dereferenced shared_ptr.
 With the shared_ptr as null I believe this code would work as intended if
 the null were not dereferenced (and then caught by a static assert before
 it actually happens).

 I'm currently testing a fix that tests against the address directly. If
 that doesn't work I don't know what the problem is.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9777>
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:15 UTC