Opened 9 years ago
#9164 new Bugs
Dereference null return value in make_shared_object.hpp
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | To Be Determined | Component: | smart_ptr |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Using some static analyzer tool , Boost reports warning messages Dereference null return value.
In codes like: boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
pd is dereference in next line : void * pv = pd->address();
If pd is NULL in above call, dereferencing it may cause crash.
It can be avoided by using: BOOST_ASSERT(!pd);
It is at many places.
Note:
See TracTickets
for help on using tickets.