linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Shalem <amir@boom.org.il>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] fix udevd read from /proc stat file
Date: Tue, 13 Sep 2005 19:13:39 +0000	[thread overview]
Message-ID: <20050913191339.GA27434@active.ath.cx> (raw)


[-- 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 --]

             reply	other threads:[~2005-09-13 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 19:13 Amir Shalem [this message]
2005-09-14 15:34 ` [PATCH] fix udevd read from /proc stat file Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050913191339.GA27434@active.ath.cx \
    --to=amir@boom.org.il \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).