raiden00pl commented on code in PR #19139:
URL: https://github.com/apache/nuttx/pull/19139#discussion_r3409999813
##########
drivers/can/ctucanfd_pci.c:
##########
@@ -760,6 +760,14 @@ static void ctucanfd_chardev_receive(FAR struct
ctucanfd_can_s *priv)
buff[0] = ctucanfd_getreg(priv, CTUCANFD_RXDATA);
+ /* buff[0] populated the frame->fmt.rwcnt. Check before use. */
+
+ if (frame->fmt.rwcnt > sizeof(buff) / sizeof(buff[0]))
Review Comment:
there is the same code below, so if you fix char dev you have to fix also
socket can:
https://github.com/apache/nuttx/blob/1282b94792767bf40cdb8fb50faf9051db0bda42/drivers/can/ctucanfd_pci.c#L1250-L1254
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]