Opened 8 years ago

Last modified 8 years ago

#10849 new Bugs

Dereferencing null pointer in Point<>::dimension_checker::apply()

Reported by: Steve Hickman <steve.hickman@…> Owned by: Barend Gehrels
Milestone: To Be Determined Component: geometry
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

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.

Change History (1)

Note: See TracTickets for help on using tickets.