All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: Christoph Lameter <cl@linux.com>
Cc: linux-kernel@vger.kernel.org
Subject: [slabinfo PATCH] Fix off-by-one after readlink() call
Date: Fri, 14 Oct 2011 18:56:20 +0200	[thread overview]
Message-ID: <4E9869B4.6080702@intra2net.com> (raw)


Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 tools/slub/slabinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/slub/slabinfo.c b/tools/slub/slabinfo.c
index 868cc93..cc1a378 100644
--- a/tools/slub/slabinfo.c
+++ b/tools/slub/slabinfo.c
@@ -1145,7 +1145,7 @@ static void read_slab_dir(void)
 		switch (de->d_type) {
 		   case DT_LNK:
 			alias->name = strdup(de->d_name);
-			count = readlink(de->d_name, buffer, sizeof(buffer));
+			count = readlink(de->d_name, buffer, sizeof(buffer)-1);
 
 			if (count < 0)
 				fatal("Cannot read symlink %s\n", de->d_name);
-- 
1.7.6.4


             reply	other threads:[~2011-10-14 17:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14 16:56 Thomas Jarosch [this message]
2011-10-14 17:16 ` [slabinfo PATCH] Fix off-by-one after readlink() call Christoph Lameter
2011-10-14 17:26   ` Thomas Jarosch
2011-10-14 17:57     ` Christoph Lameter
2011-10-14 19:53     ` David Rientjes
2011-10-17  7:16       ` Pekka Enberg
2011-10-17 14:48         ` [slabinfo PATCH v2] Fix off-by-one buffer corruption " Thomas Jarosch

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=4E9869B4.6080702@intra2net.com \
    --to=thomas.jarosch@intra2net.com \
    --cc=cl@linux.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.