All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sparc64: aout32_core_dump(): convert strncpy(x, y, sizeof(x))
@ 2008-03-06 13:27 ` Roel Kluin
  0 siblings, 0 replies; 2+ messages in thread
From: Roel Kluin @ 2008-03-06 13:27 UTC (permalink / raw)
  To: David S. Miller; +Cc: sparclinux, lkml

This patch was not yet tested. Please confirm it's right.
---
strncpy does not append '\0' if the length of the source string equals
the size parameter, strlcpy does.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index 9877f2d..0a63d18 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -100,7 +100,7 @@ static int aout32_core_dump(long signr, struct pt_regs *regs, struct file *file,
 	set_fs(KERNEL_DS);
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
-       	strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
+	strlcpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
 	dump.signal = signr;
 	aout_dump_thread(regs, &dump);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] sparc64: aout32_core_dump(): convert strncpy(x, y, sizeof(x)) to strlcpy
@ 2008-03-06 13:27 ` Roel Kluin
  0 siblings, 0 replies; 2+ messages in thread
From: Roel Kluin @ 2008-03-06 13:27 UTC (permalink / raw)
  To: David S. Miller; +Cc: sparclinux, lkml

This patch was not yet tested. Please confirm it's right.
---
strncpy does not append '\0' if the length of the source string equals
the size parameter, strlcpy does.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index 9877f2d..0a63d18 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -100,7 +100,7 @@ static int aout32_core_dump(long signr, struct pt_regs *regs, struct file *file,
 	set_fs(KERNEL_DS);
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
-       	strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
+	strlcpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
 	dump.signal = signr;
 	aout_dump_thread(regs, &dump);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-06 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06 13:27 [PATCH] sparc64: aout32_core_dump(): convert strncpy(x, y, sizeof(x)) Roel Kluin
2008-03-06 13:27 ` [PATCH] sparc64: aout32_core_dump(): convert strncpy(x, y, sizeof(x)) to strlcpy Roel Kluin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.