diff options
author | Zhao Hongjiang <zhaohongjiang@huawei.com> | 2013-07-04 00:08:28 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-04 01:08:02 +0200 |
commit | 30bc30df102b2d0c003d93477e04b97e6c528573 (patch) | |
tree | 47ddf47773fa5335036d994874af629291715fab /fs/proc | |
parent | fs/proc/uptime.c:uptime_proc_show(): use get_monotonic_boottime() (diff) | |
download | linux-30bc30df102b2d0c003d93477e04b97e6c528573.tar.xz linux-30bc30df102b2d0c003d93477e04b97e6c528573.zip |
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>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/kcore.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 0a22194e5d58..06ea155e1a59 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -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(¬es[1]); bufp = storenote(¬es[1], bufp); |