From 7a3569f80051d48ac427849c30b2f5685b368b71 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 6 Jul 2016 17:09:51 +0200 Subject: tracker/pt: fix out-of-bounds write The input array has exactly 3 points. The vector has potentially more points, sorted by circularity. Spotted-by: @DaMichel Closes #380 --- tracker-pt/point_tracker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp index 1fb4128e..51f10470 100644 --- a/tracker-pt/point_tracker.cpp +++ b/tracker-pt/point_tracker.cpp @@ -37,7 +37,7 @@ void PointModel::get_d_order(const std::vector& points, int d_order[] // fit line to orthographically projected points std::vector> d_vals; // get sort indices with respect to d scalar product - for (unsigned i = 0; i(d.dot(points[i]), i)); std::sort(d_vals.begin(), @@ -45,7 +45,7 @@ void PointModel::get_d_order(const std::vector& points, int d_order[] d_vals_sort ); - for (unsigned i = 0; i