From dfbbd36ff7888551d4a36a97d433d248940dc0de Mon Sep 17 00:00:00 2001 From: nickolasrossi Date: Tue, 19 Jan 2016 18:25:22 -0800 Subject: [PATCH] fix buffer overflow in constrain of wind velocity --- EKF/ekf_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index 1bf6bb28dd..a656d59cf8 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -158,7 +158,7 @@ void Ekf::constrainStates() _state.mag_B(i) = math::constrain(_state.mag_B(i), -0.5f, 0.5f); } - for (int i = 0; i < 3; i++) { + for (int i = 0; i < 2; i++) { _state.wind_vel(i) = math::constrain(_state.wind_vel(i), -100.0f, 100.0f); } }