This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit bae700df70958a2cd59b9221130548e45becc293
Author: chenzihan1 <[email protected]>
AuthorDate: Mon Mar 9 10:40:20 2026 +0800

    drivers/syslog/syslog_rpmsg: ignore writes before the buffer is set up
    
    When CONFIG_SYSLOG_RPMSG_BUFSIZE is 0 the platform provides the buffer
    later, and syslog output that arrives before that would dereference a
    NULL header. Drop such writes.
    
    Signed-off-by: chenzihan1 <[email protected]>
---
 drivers/syslog/syslog_rpmsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c
index e5a246731a9..39a51f37f17 100644
--- a/drivers/syslog/syslog_rpmsg.c
+++ b/drivers/syslog/syslog_rpmsg.c
@@ -225,7 +225,7 @@ static void syslog_rpmsg_addbuf(FAR struct syslog_rpmsg_s 
*priv,
   irqstate_t flags;
   uint32_t tail;
 
-  if (len <= 0)
+  if (len <= 0 || priv->header == NULL)
     {
       return;
     }

Reply via email to