Skip to content

Commit 3ca34ce

Browse files
Daniel Jaecklemluis1
authored andcommitted
Issue #849 - Update the function RegionCommonIdentifyChannels to make sure that it assigns a zero. Make sure that the function is save.
1 parent 9cc8cc5 commit 3ca34ce

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/mac/LoRaMac.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3396,6 +3396,11 @@ LoRaMacStatus_t LoRaMacQueryNextTxDelay( int8_t datarate, TimerTime_t* time )
33963396
uint32_t adrAckCounter = MacCtx.NvmCtx->AdrAckCounter;
33973397
int8_t txPower = MacCtx.NvmCtx->MacParamsDefaults.ChannelsTxPower;
33983398

3399+
if( time == NULL )
3400+
{
3401+
return LORAMAC_STATUS_PARAMETER_INVALID;
3402+
}
3403+
33993404
if( MacCtx.NvmCtx->LastTxDoneTime == 0 )
34003405
{
34013406
*time = 0;

src/mac/region/RegionCommon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ LoRaMacStatus_t RegionCommonIdentifyChannels( RegionCommonIdentifyChannelsParam_
457457

458458
if( *nbEnabledChannels > 0 )
459459
{
460+
*nextTxDelay = 0;
460461
return LORAMAC_STATUS_OK;
461462
}
462463
else if( *nbRestrictedChannels > 0 )

0 commit comments

Comments
 (0)