[Boost-bugs] [Boost C++ Libraries] #10849: Dereferencing null pointer in Point<>::dimension_checker::apply()

Subject: [Boost-bugs] [Boost C++ Libraries] #10849: Dereferencing null pointer in Point<>::dimension_checker::apply()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-12-04 18:21:04


#10849: Dereferencing null pointer in Point<>::dimension_checker::apply()
---------------------------------------------+---------------------------
 Reporter: Steve Hickman <steve.hickman@…> | Owner: barendgehrels
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
---------------------------------------------+---------------------------
 The following lines:
             P* p = 0;
             geometry::set<Dimension>(*p, geometry::get<Dimension>(*p));

 indicate that the first parameter of the set<>() call will be a null
 pointer if it is evaluated before the call to get<>().

 If this is intentional *and* you can guarantee that the get<>() call will
 always be made before the first parameter is evaluated, then it should be
 documented with comments inline. Or, better yet, split the code into 2
 lines to insure *p isn't an attempt to dereference a null pointer and to
 insure that static code checkers don't think it is.

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