[pdal-commits] [PDAL/PDAL] 2f142d: Check point view size in `getFieldAs`

GitHub noreply at github.com
Mon Nov 16 13:24:24 PST 2015


  Branch: refs/heads/master
  Home:   https://github.com/PDAL/PDAL
  Commit: 2f142d22ff1aeea99636fa6b6f080c0e79a32d41
      https://github.com/PDAL/PDAL/commit/2f142d22ff1aeea99636fa6b6f080c0e79a32d41
  Author: Pete Gadomski <pete.gadomski at gmail.com>
  Date:   2015-11-16 (Mon, 16 Nov 2015)

  Changed paths:
    M include/pdal/PointView.hpp
    M test/unit/PointViewTest.cpp

  Log Message:
  -----------
  Check point view size in `getFieldAs`

`PointView::getFieldInternal` uses `deque::operator[]` to map index
values to raw point ids. This means that a user can silently access
beyond the end of of the `m_index` deque with an ill-advised
`getFieldAs` call, leading to either garbage results or a segfault.

Per
[discussion](https://github.com/gadomski/PDAL/commit/c1d54e56e2de841d37f2a1b1c218ed723053f6a9#commitcomment-14415138)
with @abellgithub, this should be considered a user error, albeit one
that we can protect against when in debug mode. Therefore, we use an
assert to check the bounds inside `getFieldAs`.


  Commit: 193667bb226c4e40365e2268a3ee0abb0d0e7ad6
      https://github.com/PDAL/PDAL/commit/193667bb226c4e40365e2268a3ee0abb0d0e7ad6
  Author: Andrew Bell <andrew.bell.ia at gmail.com>
  Date:   2015-11-16 (Mon, 16 Nov 2015)

  Changed paths:
    M include/pdal/PointView.hpp
    M test/unit/PointViewTest.cpp

  Log Message:
  -----------
  Merge pull request #1039 from gadomski/point-view-bounds-checking

Check point view size in `getFieldInternal`


Compare: https://github.com/PDAL/PDAL/compare/f7b7218f925c...193667bb226c


More information about the pdal-commits mailing list