Commit 93bf18c7 authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

[PATCH] use strncpy in get_task_comm

From: Prasanna Meda <pmeda@akamai.com>

Set_task_comm uses strlcpy, so get_task_comm must use strncpy.
Signed-Off-by: default avatarPrasanna Meda <pmeda@akamai.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2b68239f
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment