Seeed_Arduino_CAN icon indicating copy to clipboard operation
Seeed_Arduino_CAN copied to clipboard

padding bytes in mcp2518fd_TransmitChannelLoad method is written into wrong locations

Open AntDeM opened this issue 4 years ago • 1 comments

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.

AntDeM avatar Oct 12 '21 09:10 AntDeM

@thePapero welcome to send PR to us. we hope your name appears in the code commit history.

Pillar1989 avatar Oct 12 '21 09:10 Pillar1989