From: "Randy.Dunlap" <rddunlap@osdl.org>
To: linux-mips@linux-mips.org
Cc: ralf@gnu.org, rddunlap <rddunlap@osdl.org>
Subject: [PATCH] MIPS getdomainname() off by 1;
Date: Mon, 31 May 2004 20:21:01 -0700 [thread overview]
Message-ID: <20040531202101.4ace5e95.rddunlap@osdl.org> (raw)
irix_getdomainname() max size appears to be off by 1;
other similar code in kernel uses __NEW_UTS_LEN as the max size,
and <domainname> includes an extra byte for the terminating
null character.
Does sysirix.c need to limit <len> to 63 instead of 64 for some
reason?
diffstat:=
arch/mips/kernel/sysirix.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff -Naurp ./arch/mips/kernel/sysirix.c~uts_len_off1 ./arch/mips/kernel/sysirix.c
--- ./arch/mips/kernel/sysirix.c~uts_len_off1 2004-05-31 13:58:24.000000000 -0700
+++ ./arch/mips/kernel/sysirix.c 2004-05-31 20:11:42.000000000 -0700
@@ -913,8 +913,8 @@ asmlinkage int irix_getdomainname(char *
return error;
down_read(&uts_sem);
- if(len > (__NEW_UTS_LEN - 1))
- len = __NEW_UTS_LEN - 1;
+ if (len > __NEW_UTS_LEN)
+ len = __NEW_UTS_LEN;
error = 0;
if (copy_to_user(name, system_utsname.domainname, len))
error = -EFAULT;
--
~Randy
next reply other threads:[~2004-06-01 3:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-01 3:21 Randy.Dunlap [this message]
2004-07-08 0:49 ` [PATCH] MIPS getdomainname() off by 1; Ralf Baechle
2004-07-08 8:46 ` Geert Uytterhoeven
2004-07-08 10:56 ` Ralf Baechle
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=20040531202101.4ace5e95.rddunlap@osdl.org \
--to=rddunlap@osdl.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@gnu.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.