From: Roel Kluin <12o3l@tiscali.nl>
To: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] sparc64: aout32_core_dump(): convert strncpy(x, y, sizeof(x))
Date: Thu, 06 Mar 2008 13:27:36 +0000 [thread overview]
Message-ID: <47CFF148.8050608@tiscali.nl> (raw)
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);
WARNING: multiple messages have this Message-ID (diff)
From: Roel Kluin <12o3l@tiscali.nl>
To: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] sparc64: aout32_core_dump(): convert strncpy(x, y, sizeof(x)) to strlcpy
Date: Thu, 06 Mar 2008 14:27:36 +0100 [thread overview]
Message-ID: <47CFF148.8050608@tiscali.nl> (raw)
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);
next reply other threads:[~2008-03-06 13:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 13:27 Roel Kluin [this message]
2008-03-06 13:27 ` [PATCH] sparc64: aout32_core_dump(): convert strncpy(x, y, sizeof(x)) to strlcpy Roel Kluin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47CFF148.8050608@tiscali.nl \
--to=12o3l@tiscali.nl \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.