shizacat commented on code in PR #18759:
URL: https://github.com/apache/nuttx/pull/18759#discussion_r3113510675


##########
arch/arm/src/stm32/stm32_can.c:
##########
@@ -1533,6 +1533,14 @@ static int stm32can_rxinterrupt(struct can_dev_s *dev, 
int rxmb)
   DEBUGASSERT(dev != NULL && dev->cd_priv != NULL);
   priv = dev->cd_priv;
 
+  /* Clear full header:
+   * padding and optional fields (timestamp, etc.) must
+   * not contain stack garbage or memcmp() in apps (e.g. examples/can with
+   * CONFIG_CAN_LOOPBACK) will falsely fail vs. zero-initialized TX header.
+   */
+
+  memset(&hdr, 0, sizeof(hdr));

Review Comment:
   Ok



-- 
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]

Reply via email to