Skip to content

Commit 9f3069f

Browse files
committed
unittests: Test_LoRaMac.post_process_mcps_req: Fix segfault
We had commented out a line where we reset LoRaPHY_stub::uint16_value to 0. This was causing an invalid array access in LoRaMac::handle_data_frame, when trying to extract the _mps_indication.channel from list of channel_params_t returned by lora_phy->get_phy_channels.
1 parent b0c0fc9 commit 9f3069f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramac/Test_LoRaMac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ TEST_F(Test_LoRaMac, post_process_mcps_req)
432432
LoRaMacCrypto_stub::int_table_idx_value = 0;
433433
LoRaMacCrypto_stub::int_table[0] = 4;
434434
LoRaMacCrypto_stub::int_table[1] = 4;
435-
// LoRaPHY_stub::uint16_value = 0;
435+
LoRaPHY_stub::uint16_value = 0;
436436
object->on_radio_rx_done(payload, 16, 0, 0);
437437
object->post_process_mcps_req();
438438

0 commit comments

Comments
 (0)