All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS getdomainname() off by 1;
@ 2004-06-01  3:21 Randy.Dunlap
  2004-07-08  0:49 ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Randy.Dunlap @ 2004-06-01  3:21 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf, rddunlap


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

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

end of thread, other threads:[~2004-07-08 10:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-01  3:21 [PATCH] MIPS getdomainname() off by 1; Randy.Dunlap
2004-07-08  0:49 ` Ralf Baechle
2004-07-08  8:46   ` Geert Uytterhoeven
2004-07-08 10:56     ` Ralf Baechle

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.