cuiziwei1 commented on code in PR #12988:
URL: https://github.com/apache/nuttx/pull/12988#discussion_r1722824350


##########
drivers/note/note_driver.c:
##########
@@ -652,7 +652,10 @@ void sched_note_start(FAR struct tcb_s *tcb)
            */
 
 #if CONFIG_TASK_NAME_SIZE > 0
-          namelen = strlen(tcb->name);
+          if (tcb->name[0] != '\0')
+            {
+              namelen = strlen(tcb->name);

Review Comment:
   when use **strnlen**,I fount this problem:
   note/note_driver.c:674:21: error: 'strnlen' specified bound 32 exceeds 
source size 0 [-Werror=stringop-overread] 
   In fact, it has been determined that CONFIG_TASK_NAME_SIZE>0, but without 
judging whether tcb->name is empty, the compiler still reports an error, 
perhaps a false positive from gcc13.



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to