Skip to content

Commit

Permalink
force immediate abort when received packet length is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
jcw committed Apr 8, 2016
1 parent 9accb01 commit 68f6e42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RF69.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ void RF69::interrupt_compat () {
uint8_t in = readReg(REG_FIFO);
recvBuf[rxfill++] = in;
crc = _crc16_update(crc, in);
if (rf12_len > RF12_MAXDATA)
rxfill = RF_MAX; // bail out now, the length is invalid
if (rxfill >= rf12_len + 5 || rxfill >= RF_MAX)
break;
}
Expand Down

0 comments on commit 68f6e42

Please sign in to comment.