Skip to content

Commit e851b07

Browse files
SWW13mluis1
authored andcommitted
Fixed potential buffer overflow in ProcessRadioRxDone
1 parent a166830 commit e851b07

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/mac/LoRaMac.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,14 @@ static void ProcessRadioRxDone( void )
938938
}
939939
}
940940

941+
// Abort on empty radio frames
942+
if( size == 0 )
943+
{
944+
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
945+
PrepareRxDoneAbort( );
946+
return;
947+
}
948+
941949
macHdr.Value = payload[pktHeaderLen++];
942950

943951
// Accept frames of LoRaWAN Major Version 1 only

0 commit comments

Comments
 (0)