From a3c3f7af3c2590816b86b5ab6cd700c8ba1467b9 Mon Sep 17 00:00:00 2001 From: Hasnain Virk Date: Tue, 4 Sep 2018 15:21:40 +0300 Subject: [PATCH] LoRaWAN: Memory overrun correction A typo in LoRaPHYCN470 is causing memory overrun. We were supposed to fill-in default channel mask and iterate over CN470_CHANNEL_MASK_SIZE times. --- features/lorawan/lorastack/phy/LoRaPHYCN470.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/lorawan/lorastack/phy/LoRaPHYCN470.cpp b/features/lorawan/lorastack/phy/LoRaPHYCN470.cpp index 6a004eb9e5..777677765a 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYCN470.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYCN470.cpp @@ -220,7 +220,7 @@ LoRaPHYCN470::LoRaPHYCN470() } // Initialize the channels default mask - for (uint8_t i = 0; i < CN470_MAX_NB_CHANNELS; i++) { + for (uint8_t i = 0; i < CN470_CHANNEL_MASK_SIZE; i++) { default_channel_mask[i] = 0xFFFF & fsb_mask[i]; }