Skip to content

Commit

Permalink
Fixed potential buffer overflow in ProcessRadioRxDone
Browse files Browse the repository at this point in the history
  • Loading branch information
SWW13 authored and mluis1 committed Oct 4, 2022
1 parent a166830 commit e851b07
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mac/LoRaMac.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,14 @@ static void ProcessRadioRxDone( void )
}
}

// Abort on empty radio frames
if( size == 0 )
{
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
PrepareRxDoneAbort( );
return;
}

macHdr.Value = payload[pktHeaderLen++];

// Accept frames of LoRaWAN Major Version 1 only
Expand Down

0 comments on commit e851b07

Please sign in to comment.