public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [slabinfo PATCH] Fix off-by-one after readlink() call
@ 2011-10-14 16:56 Thomas Jarosch
  2011-10-14 17:16 ` Christoph Lameter
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Jarosch @ 2011-10-14 16:56 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-kernel


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


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

end of thread, other threads:[~2011-10-17 14:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14 16:56 [slabinfo PATCH] Fix off-by-one after readlink() call Thomas Jarosch
2011-10-14 17:16 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox