Lora-net / SWL2001

LoRa Basics Modem LoRaWAN stack
BSD 3-Clause Clear License
87 stars 50 forks source link

Flash porting test always failing due to array out of bounds access #44

Closed non-det-alle closed 2 months ago

non-det-alle commented 4 months ago

This line in lbm_examples/main_examples /main_porting_tests.c will always cause a SIGSEGV because the modem_context_type_t enum element CONTEXT_SECURE_ELEMENT=4 is used as index of the name_context_type array which has max index 3.

lbm-team commented 4 months ago

Hi non-det-alle,

can you try with this modification:

static const char* name_context_type[] = { "MODEM", "KEY_MODEM", "LORAWAN_STACK", "FUOTA", "SECURE_ELEMENT", "STORE_AND_FORWARD" };

non-det-alle commented 4 months ago

Hello. Yes I know, that's what I already proposed in pull request #45 related to this issue. I'll change the names as per your suggestion.