Skip to contentSkip to conversation

fix udevd read from /proc stat file

PATCH Applied Amir Shalem 2 participants 2 messages Sep 13, 2005 – Sep 14, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix udevd read from /proc stat file

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

Signature · 1 line
	Amir.
udevd.c +2 -2
diff -Nur udev-068.orig/udevd.c udev-068/udevd.c
@@ -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)
Applied
#1 lore raw
Quoted 3 lines · Amir Shalem

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

Applied!

Thanks,
Kay

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel