diff --git a/binfmt/libelf/libelf_coredump.c b/binfmt/libelf/libelf_coredump.c index a012ce441c..014621aca5 100644 --- a/binfmt/libelf/libelf_coredump.c +++ b/binfmt/libelf/libelf_coredump.c @@ -227,11 +227,11 @@ static void elf_emit_note_info(FAR struct elf_dumpinfo_s *cinfo) elf_emit(cinfo, &nhdr, sizeof(nhdr)); - strncpy(name, tcb->name, sizeof(name)); + strlcpy(name, tcb->name, sizeof(name)); elf_emit(cinfo, name, sizeof(name)); info.pr_pid = tcb->pid; - strncpy(info.pr_fname, tcb->name, sizeof(info.pr_fname)); + strlcpy(info.pr_fname, tcb->name, sizeof(info.pr_fname)); elf_emit(cinfo, &info, sizeof(info)); /* Fill Process status */