sched_note: fix buffer size warning in coverity
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
parent
27c80f2586
commit
c46a926e2b
@ -494,7 +494,7 @@ void sched_note_start(FAR struct tcb_s *tcb)
|
|||||||
namelen = strlen(tcb->name);
|
namelen = strlen(tcb->name);
|
||||||
|
|
||||||
DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE);
|
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);
|
length = SIZEOF_NOTE_START(namelen + 1);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user