Skip to content

Commit

Permalink
Fixed an out of bounds read in void rosbag::View::iterator::increment…
Browse files Browse the repository at this point in the history
…() (#1191)

- Only triggered if reduce_overlap_ = true
- When iters_.size() == 1 and iters_.pop_back() gets called in the loop,
  the next loop condition check would read from iters_.back(), but
  iters_ would be empty by then.
  • Loading branch information
racko authored and dirk-thomas committed Oct 26, 2017
1 parent 3cfef19 commit 4ff5bd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/rosbag_storage/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void View::iterator::increment() {
{
std::multiset<IndexEntry>::const_iterator last_iter = iters_.back().iter;

while (iters_.back().iter == last_iter)
while (!iters_.empty() && iters_.back().iter == last_iter)
{
iters_.back().iter++;
if (iters_.back().iter == iters_.back().range->end)
Expand Down

0 comments on commit 4ff5bd8

Please sign in to comment.