From 92df97b5edc6fb4488a4140aa48482e0761dc4c4 Mon Sep 17 00:00:00 2001 From: Tim Rakowski Date: Mon, 16 Oct 2017 22:10:28 +0200 Subject: [PATCH] Fixed an out of bounds read in void rosbag::View::iterator::increment() - 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. --- tools/rosbag_storage/src/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rosbag_storage/src/view.cpp b/tools/rosbag_storage/src/view.cpp index 81cae14ed8..dbb1e72478 100644 --- a/tools/rosbag_storage/src/view.cpp +++ b/tools/rosbag_storage/src/view.cpp @@ -136,7 +136,7 @@ void View::iterator::increment() { { std::multiset::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)