Commit 30bc30df102b2d0c003d93477e04b97e6c528573
Committed by
Linus Torvalds
1 parent
1d98a5fa11
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
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
fs/proc/kcore.c
... | ... | @@ -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(¬es[1]); |
414 | 414 | bufp = storenote(¬es[1], bufp); |