Modify

Opened 4 years ago

#9164 new Bugs

Dereference null return value in make_shared_object.hpp

Reported by: Gaurav Gupta <g.gupta@…> 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.

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Peter Dimov.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.