linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix udevd read from /proc stat file
@ 2005-09-13 19:13 Amir Shalem
  2005-09-14 15:34 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Amir Shalem @ 2005-09-13 19:13 UTC (permalink / raw)
  To: linux-hotplug


[-- Attachment #1.1: Type: text/plain, Size: 150 bytes --]

fix two udevd read() calls from /proc stat file,
must make sure there's room for null byte in buffer
which we put in after read()

-- 
	Amir.


[-- Attachment #1.2: write-over-end.diff --]
[-- Type: text/plain, Size: 482 bytes --]

diff -Nur udev-068.orig/udevd.c udev-068/udevd.c
--- udev-068.orig/udevd.c	Thu Aug 18 20:04:49 2005
+++ udev-068/udevd.c	Tue Sep 13 21:31:38 2005
@@ -205,7 +205,7 @@
 	if (f == -1)
 		return -1;
 
-	len = read(f, buf, sizeof(buf));
+	len = read(f, buf, sizeof(buf)-1);
 	close(f);
 
 	if (len <= 0)
@@ -254,7 +254,7 @@
 		if (f == -1)
 			continue;
 
-		len = read(f, line, sizeof(line));
+		len = read(f, line, sizeof(line)-1);
 		close(f);
 
 		if (len <= 0)

[-- Attachment #2: Type: application/pgp-signature, Size: 187 bytes --]

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

end of thread, other threads:[~2005-09-14 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-13 19:13 [PATCH] fix udevd read from /proc stat file Amir Shalem
2005-09-14 15:34 ` Kay Sievers

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