Seeed_Arduino_CAN
Seeed_Arduino_CAN copied to clipboard
padding bytes in mcp2518fd_TransmitChannelLoad method is written into wrong locations
Padding bytes added to write a multiple of 4 bytes into RAM is written to wrong location because the offset of 8 is added two times:
- one in row https://github.com/Seeed-Studio/Seeed_Arduino_CAN/blob/6acaf5a2585a4da3f5751cd556b50ca32d157adf/src/mcp2518fd_can.cpp#L1370
- and the second time in for loop: https://github.com/Seeed-Studio/Seeed_Arduino_CAN/blob/6acaf5a2585a4da3f5751cd556b50ca32d157adf/src/mcp2518fd_can.cpp#L1373
The worst case is when txdNumBytes is greater than 56. In this case txBuffer is written out of bounds.
@thePapero welcome to send PR to us. we hope your name appears in the code commit history.