From dd8d6be5a9d97756c6464998d2c0bf3de09d84bf Mon Sep 17 00:00:00 2001 From: Morgan Diepart Date: Tue, 5 Nov 2024 19:04:13 +0100 Subject: [PATCH] M17: Synchronizer: fixed uninitialized variable and out-of-bounds array access. --- openrtx/include/protocols/M17/Synchronizer.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openrtx/include/protocols/M17/Synchronizer.hpp b/openrtx/include/protocols/M17/Synchronizer.hpp index 163398af..759b66a9 100644 --- a/openrtx/include/protocols/M17/Synchronizer.hpp +++ b/openrtx/include/protocols/M17/Synchronizer.hpp @@ -41,7 +41,7 @@ public: * @param sync_word: symbols of the target syncword. */ Synchronizer(std::array< int8_t, SYNCW_SIZE >&& sync_word) : - syncword(std::move(sync_word)) { } + syncword(std::move(sync_word)), triggered(false) { } /** * Destructor. @@ -96,7 +96,7 @@ public: index += 1; } - if(values[index] >= 0) + if(peak >= 0) sign = 1; else sign = -1;