Reject CAN frames with length > 8
Previously, they were just truncated. In any case, this is only hit if the userspace daemon gives us more than 8 bytes for CAN, which it shouldn't.tx-receipts
parent
668e50d08c
commit
6bbcf1b527
|
|
@ -471,7 +471,10 @@ static int intrepid_fill_can_frame_from_neomessage(
|
|||
if (msg->status.remoteFrame)
|
||||
cf->can_id |= CAN_RTR_FLAG;
|
||||
|
||||
cf->can_dlc = get_can_dlc(msg->length);
|
||||
if (unlikely(msg->length > 8))
|
||||
return -1;
|
||||
|
||||
cf->can_dlc = msg->length;
|
||||
memcpy(cf->data, data, cf->can_dlc);
|
||||
|
||||
stats->rx_bytes += cf->can_dlc;
|
||||
|
|
|
|||
Loading…
Reference in New Issue