Commit 98fc640f authored by Prasanna Meda's avatar Prasanna Meda Committed by Linus Torvalds

[PATCH] use strncpy in get_task_comm

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 avatarLinus Torvalds <torvalds@osdl.org>
parent 6b291c02
...@@ -815,7 +815,7 @@ void get_task_comm(char *buf, struct task_struct *tsk) ...@@ -815,7 +815,7 @@ void get_task_comm(char *buf, struct task_struct *tsk)
{ {
/* buf must be at least sizeof(tsk->comm) in size */ /* buf must be at least sizeof(tsk->comm) in size */
task_lock(tsk); task_lock(tsk);
memcpy(buf, tsk->comm, sizeof(tsk->comm)); strncpy(buf, tsk->comm, sizeof(tsk->comm));
task_unlock(tsk); 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