From 40a3f98222a96880f052ac47b54198c85450148d Mon Sep 17 00:00:00 2001 From: Garag Date: Fri, 5 May 2023 21:22:01 +0200 Subject: [PATCH] fix off by one after SRV_MAC_LINK_ADR_REQ when only one byte left --- src/mac/LoRaMac.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mac/LoRaMac.c b/src/mac/LoRaMac.c index 03bf4e400..53806b830 100644 --- a/src/mac/LoRaMac.c +++ b/src/mac/LoRaMac.c @@ -2276,11 +2276,8 @@ static void ProcessMacCommands( uint8_t *payload, uint8_t macIndex, uint8_t comm } while( payload[macIndex++] == SRV_MAC_LINK_ADR_REQ ); - if( macIndex < commandsSize ) - { - // Decrease the index such that it points to the next MAC command - macIndex--; - } + // Decrease the index such that it points to the next MAC command + macIndex--; } else {