linux-mips
[Top] [All Lists]

[PATCH] MIPS getdomainname() off by 1;

To: linux-mips@linux-mips.org
Subject: [PATCH] MIPS getdomainname() off by 1;
From: "Randy.Dunlap" <rddunlap@osdl.org>
Date: Mon, 31 May 2004 20:21:01 -0700
Cc: ralf@gnu.org, rddunlap <rddunlap@osdl.org>
Organization: OSDL
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
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

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS getdomainname() off by 1;, Randy.Dunlap <=