Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30bc30df authored by Zhao Hongjiang's avatar Zhao Hongjiang Committed by Linus Torvalds
Browse files

fs/proc/kcore.c: using strlcpy() instead of strncpy()



For NUL terminated string, set '\0' at the end.

Signed-off-by: default avatarZhao Hongjiang <zhaohongjiang@huawei.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1d98a5fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff)
	prpsinfo.pr_zomb	= 0;

	strcpy(prpsinfo.pr_fname, "vmlinux");
	strncpy(prpsinfo.pr_psargs, saved_command_line, ELF_PRARGSZ);
	strlcpy(prpsinfo.pr_psargs, saved_command_line, sizeof(prpsinfo.pr_psargs));

	nhdr->p_filesz	+= notesize(&notes[1]);
	bufp = storenote(&notes[1], bufp);