Skip to content

Commit 9e3adb2

Browse files
committed
LoRaMac Rx FRAME_TYPE_PROPRIETARY: memcpy out of bounds fix
The payload *after* packet header is copied (payload+pktHeaderLen), but the full size of the packet is still used. It seems like this should be size - pktHeaderLen.
1 parent cbde060 commit 9e3adb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mac/LoRaMac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ static void ProcessRadioRxDone( void )
13081308

13091309
break;
13101310
case FRAME_TYPE_PROPRIETARY:
1311-
memcpy1( MacCtx.RxPayload, &payload[pktHeaderLen], size );
1311+
memcpy1( MacCtx.RxPayload, &payload[pktHeaderLen], size - pktHeaderLen );
13121312

13131313
MacCtx.McpsIndication.McpsIndication = MCPS_PROPRIETARY;
13141314
MacCtx.McpsIndication.Status = LORAMAC_EVENT_INFO_STATUS_OK;

0 commit comments

Comments
 (0)