AP_HAL: fixed valgrind error

This commit is contained in:
Andrew Tridgell 2023-04-07 16:39:06 +10:00
parent 85d4024e64
commit 57f6343058
1 changed files with 1 additions and 0 deletions

View File

@ -105,6 +105,7 @@ AP_HAL::CANFrame::CANFrame(uint32_t can_id, const uint8_t* can_data, uint8_t dat
return;
}
memcpy(this->data, can_data, data_len);
memset(&this->data[data_len], 0, MaxDataLen-data_len);
if (data_len <= NonFDCANMaxDataLen) {
dlc = data_len;
} else {