Commit 30bc30df102b2d0c003d93477e04b97e6c528573

Authored by Zhao Hongjiang
Committed by Linus Torvalds
1 parent 1d98a5fa11

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

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

Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -408,7 +408,7 @@
408 408 prpsinfo.pr_zomb = 0;
409 409  
410 410 strcpy(prpsinfo.pr_fname, "vmlinux");
411   - strncpy(prpsinfo.pr_psargs, saved_command_line, ELF_PRARGSZ);
  411 + strlcpy(prpsinfo.pr_psargs, saved_command_line, sizeof(prpsinfo.pr_psargs));
412 412  
413 413 nhdr->p_filesz += notesize(&notes[1]);
414 414 bufp = storenote(&notes[1], bufp);