rt-thread
rt-thread copied to clipboard
rt_can_read memory write out of boundary
function _can_int_rx in components/drivers/can/can.c
/* read from software FIFO */
while (msgs)
{
...
rt_memcpy(data, &listmsg->data, sizeof(struct rt_can_msg));
...
data ++;
msgs -= sizeof(struct rt_can_msg);
}
didn't validate the data length and rx_fifo->uselist msgs length while calling _can_int_rx in rt_can_read, if msgs > datalength, it could result in memory write out of boundary.
欢迎提交PR~
https://github.com/RT-Thread/rt-thread/pull/9149