linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] use strncpy in get_task_comm
@ 2005-03-12 19:20 pmeda
  0 siblings, 0 replies; only message in thread
From: pmeda @ 2005-03-12 19:20 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm

Set_task_comm uses strlcpy, so get_task_comm must use strncpy.

Signed-Off-by: Prasanna Meda <pmeda@akamai.com>

--- Linux/fs/exec.c	Sat Mar 12 01:12:47 2005
+++ linux/fs/exec.c	Sat Mar 12 17:27:49 2005
@@ -814,7 +814,7 @@
 {
 	/* 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);
 }
 
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-12 19:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-12 19:20 [PATCH] use strncpy in get_task_comm pmeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox