linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware_helper.c: correct amount uploaded
@ 2005-09-09  8:31 Duncan Sands
  2005-09-09 10:42 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Duncan Sands @ 2005-09-09  8:31 UTC (permalink / raw)
  To: linux-hotplug

Uploading more than the buffer holds is not a good idea...

--- udev-068/extras/firmware/firmware_helper.c.orig	2005-09-07 19:50:43.000000000 +0200
+++ udev-068/extras/firmware/firmware_helper.c	2005-09-08 19:54:28.000000000 +0200
@@ -120,7 +120,7 @@
 	while (count < fw_buffer_size) {
 		int c;
 
-		c = write(fw_fd, fw_buffer+count, fw_buffer_size);
+		c = write(fw_fd, fw_buffer+count, fw_buffer_size-count);
 		if (c <= 0) {
 			rc = errno;
 			close(fw_fd);


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2005-09-09 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-09  8:31 [PATCH] firmware_helper.c: correct amount uploaded Duncan Sands
2005-09-09 10:42 ` Kay Sievers
2005-09-09 16:20 ` Olivier Blin
2005-09-09 16:41 ` Duncan Sands

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).