public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bad strlcpy conversion breaks toshiba_acpi
@ 2003-07-25 14:46 John Belmonte
       [not found] ` <3F2142CE.4090608-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: John Belmonte @ 2003-07-25 14:46 UTC (permalink / raw)
  To: Ben Collins, Linus Torvalds
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Michael Wawrzyniak

Please revert the following item from Ben Collins' "drivers/* strlcpy 
conversions" patch dated 2003-May-26.

The strlcpy function requires a zero-terminated string, which is not a 
valid assumption for the code in question.  I suggest that Ben review 
all such modifications he made to the kernel for similar errors.  It's 
quite annoying to have someone add bugs to your driver while you're not 
looking.  Either notify the maintainer of your patch or don't make mistakes.

Another gripe I have is that bitkeeper user "bcollins" does not have a 
valid email address.

-John Belmonte


Item to be REVERTED:

--- 1.9/drivers/acpi/toshiba_acpi.c	Mon May 19 10:57:16 2003
+++ 1.10/drivers/acpi/toshiba_acpi.c	Sun May 25 17:00:00 2003
@@ -108,8 +108,7 @@
  	int result;
  	char* str2 = kmalloc(n + 1, GFP_KERNEL);
  	if (str2 == 0) return 0;
-	strncpy(str2, str, n);
-	str2[n] = 0;
+	strlcpy(str2, str, n);
  	va_start(args, format);
  	result = vsscanf(str2, format, args);
  	va_end(args);


References:

http://www.ussg.iu.edu/hypermail/linux/kernel/0305.3/0267.html
http://linux-acpi.bkbits.net:8080/linux-acpi/diffs/drivers/acpi/toshiba_acpi.c-6aIl+mEMC3M@public.gmane.org?nav=index.html|src/|src/drivers|src/drivers/acpi|hist/drivers/acpi/toshiba_acpi.c


-- 
http:// if   l .o  /

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

end of thread, other threads:[~2003-07-27 21:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-25 14:46 [PATCH] bad strlcpy conversion breaks toshiba_acpi John Belmonte
     [not found] ` <3F2142CE.4090608-ZFKsivP1bGvOQU1ULcgDhA@public.gmane.org>
2003-07-25 16:15   ` Petr Vandrovec
     [not found]     ` <20030725161510.GA31565-Kr4v8scruuLwY2GEPTd/bA@public.gmane.org>
2003-07-25 16:57       ` Andries Brouwer
     [not found]         ` <20030725165709.GA670-ek1Qb6IBo2Pz+pZb47iToQ@public.gmane.org>
2003-07-27 21:02           ` Matthew Wilcox
     [not found]             ` <20030727210203.GU1485-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2003-07-27 21:26               ` M. Warner Losh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox