From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: PATCH: more wrong strlcpy's
Date: Fri, 11 Jul 2003 19:16:52 +0100 [thread overview]
Message-ID: <200307111816.h6BIGqnu017392@hraefn.swansea.linux.org.uk> (raw)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.75/sound/oss/sonicvibes.c linux-2.5.75-ac1/sound/oss/sonicvibes.c
--- linux-2.5.75/sound/oss/sonicvibes.c 2003-07-10 21:08:53.000000000 +0100
+++ linux-2.5.75-ac1/sound/oss/sonicvibes.c 2003-07-11 16:27:40.000000000 +0100
@@ -1046,8 +1046,8 @@
VALIDATE_STATE(s);
if (cmd == SOUND_MIXER_INFO) {
mixer_info info;
- strlcpy(info.id, "SonicVibes", sizeof(info.id));
- strlcpy(info.name, "S3 SonicVibes", sizeof(info.name));
+ strncpy(info.id, "SonicVibes", sizeof(info.id));
+ strncpy(info.name, "S3 SonicVibes", sizeof(info.name));
info.modify_counter = s->mix.modcnt;
if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT;
@@ -1055,8 +1055,8 @@
}
if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info;
- strlcpy(info.id, "SonicVibes", sizeof(info.id));
- strlcpy(info.name, "S3 SonicVibes", sizeof(info.name));
+ strncpy(info.id, "SonicVibes", sizeof(info.id));
+ strncpy(info.name, "S3 SonicVibes", sizeof(info.name));
if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT;
return 0;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.75/sound/oss/soundcard.c linux-2.5.75-ac1/sound/oss/soundcard.c
--- linux-2.5.75/sound/oss/soundcard.c 2003-07-10 21:09:33.000000000 +0100
+++ linux-2.5.75-ac1/sound/oss/soundcard.c 2003-07-11 16:27:26.000000000 +0100
@@ -289,8 +289,8 @@
{
mixer_info info;
- strlcpy(info.id, mixer_devs[dev]->id, sizeof(info.id));
- strlcpy(info.name, mixer_devs[dev]->name, sizeof(info.name));
+ strncpy(info.id, mixer_devs[dev]->id, sizeof(info.id));
+ strncpy(info.name, mixer_devs[dev]->name, sizeof(info.name));
info.modify_counter = mixer_devs[dev]->modify_counter;
if (__copy_to_user(arg, &info, sizeof(info)))
return -EFAULT;
@@ -301,8 +301,8 @@
{
_old_mixer_info info;
- strlcpy(info.id, mixer_devs[dev]->id, sizeof(info.id));
- strlcpy(info.name, mixer_devs[dev]->name, sizeof(info.name));
+ strncpy(info.id, mixer_devs[dev]->id, sizeof(info.id));
+ strncpy(info.name, mixer_devs[dev]->name, sizeof(info.name));
if (copy_to_user(arg, &info, sizeof(info)))
return -EFAULT;
return 0;
reply other threads:[~2003-07-11 18:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200307111816.h6BIGqnu017392@hraefn.swansea.linux.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).