[PATCH] use strncpy in get_task_comm

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>
This commit is contained in:
Prasanna Meda 2005-03-15 15:39:08 -08:00 committed by Greg KH
parent 7a5be74f06
commit a39b38c997
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}