From c46a926e2b0783c7b7b4a32c2d844386fba2b6ca Mon Sep 17 00:00:00 2001 From: zhuyanlin Date: Wed, 30 Mar 2022 20:53:48 +0800 Subject: [PATCH] sched_note: fix buffer size warning in coverity Signed-off-by: zhuyanlin --- sched/sched/sched_note.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/sched/sched_note.c b/sched/sched/sched_note.c index 24659b41cb..ad512d5db6 100644 --- a/sched/sched/sched_note.c +++ b/sched/sched/sched_note.c @@ -494,7 +494,7 @@ void sched_note_start(FAR struct tcb_s *tcb) namelen = strlen(tcb->name); DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE); - strncpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1); + strlcpy(note.nsa_name, tcb->name, sizeof(note.nsa_name)); length = SIZEOF_NOTE_START(namelen + 1); #else