]> git.hungrycats.org Git - linux/commitdiff
[PATCH] use strncpy in get_task_comm
authorAndrew Morton <akpm@osdl.org>
Tue, 15 Mar 2005 07:39:08 +0000 (23:39 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Mar 2005 07:39:08 +0000 (23:39 -0800)
From: Prasanna Meda <pmeda@akamai.com>

Set_task_comm uses strlcpy, so get_task_comm must use strncpy.

Signed-Off-by: Prasanna Meda <pmeda@akamai.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/exec.c

index ee58e91a9d7f44092075f4dbf6bb7d4302484631..b76cdcc74a875156fc9dbacf2568f2f83fb7312a 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -814,7 +814,7 @@ void get_task_comm(char *buf, struct task_struct *tsk)
 {
        /* buf must be at least sizeof(tsk->comm) in size */
        task_lock(tsk);
-       memcpy(buf, tsk->comm, sizeof(tsk->comm));
+       strncpy(buf, tsk->comm, sizeof(tsk->comm));
        task_unlock(tsk);
 }