ETHER: Fix packet length check to properly accomodate CRC data if needed
As discussed in #419
This commit is contained in:
parent
00f6cd59a2
commit
c48b254228
1 changed files with 1 additions and 1 deletions
|
@ -907,7 +907,7 @@ void ethq_insert_data(ETH_QUE* que, int32 type, const uint8 *data, int used, siz
|
|||
item->packet.len = len;
|
||||
item->packet.used = used;
|
||||
item->packet.crc_len = crc_len;
|
||||
if (MAX (len, crc_len) <= sizeof (item->packet.msg) - ETH_CRC_SIZE) {
|
||||
if (MAX (len, crc_len) <= sizeof (item->packet.msg)) {
|
||||
memcpy(item->packet.msg, data, ((len > crc_len) ? len : crc_len));
|
||||
if (crc_data && (crc_len > len))
|
||||
memcpy(&item->packet.msg[len], crc_data, ETH_CRC_SIZE);
|
||||
|
|
Loading…
Add table
Reference in a new issue