From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amir Shalem Date: Tue, 13 Sep 2005 19:13:39 +0000 Subject: [PATCH] fix udevd read from /proc stat file Message-Id: <20050913191339.GA27434@active.ath.cx> MIME-Version: 1 Content-Type: multipart/mixed; boundary="/NkBOFFp2J2Af1nK" List-Id: To: linux-hotplug@vger.kernel.org --/NkBOFFp2J2Af1nK Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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() --=20 Amir. --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="write-over-end.diff" Content-Transfer-Encoding: quoted-printable 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 =3D=3D -1) return -1; =20 - len =3D read(f, buf, sizeof(buf)); + len =3D read(f, buf, sizeof(buf)-1); close(f); =20 if (len <=3D 0) @@ -254,7 +254,7 @@ if (f =3D=3D -1) continue; =20 - len =3D read(f, line, sizeof(line)); + len =3D read(f, line, sizeof(line)-1); close(f); =20 if (len <=3D 0) --qMm9M+Fa2AknHoGS-- --/NkBOFFp2J2Af1nK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDJyTj6GJjqfuvOIgRAlYpAJ49B3wCqraWl5sTJqHlsLI88bOwhwCfahWb Ctjtr9ntXNvKl9AN4dV4ksk= =1Y5z -----END PGP SIGNATURE----- --/NkBOFFp2J2Af1nK-- ------------------------------------------------------- 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 Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel