Opened 8 years ago
Last modified 8 years ago
#10849 new Bugs
Dereferencing null pointer in Point<>::dimension_checker::apply()
Reported by: | 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.
Note:
See TracTickets
for help on using tickets.
Are you asking about the code in the Point concept (https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/concepts/point_concept.hpp) ?