[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E986ABF.9040706@intra2net.com>
Date: Fri, 14 Oct 2011 19:00:47 +0200
From: Thomas Jarosch <thomas.jarosch@...ra2net.com>
To: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
CC: linux-kernel@...r.kernel.org
Subject: [perf PATCH] Fix possible unterminated readlink() result buffer
No need to do "buf[len] = '\0';" since the buffer
is allocated with zalloc().
Signed-off-by: Thomas Jarosch <thomas.jarosch@...ra2net.com>
---
tools/perf/util/header.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index b6c1ad1..1a1c026 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -267,7 +267,7 @@ int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir)
if (access(linkname, F_OK))
goto out_free;
- if (readlink(linkname, filename, size) < 0)
+ if (readlink(linkname, filename, size-1) < 0)
goto out_free;
if (unlink(linkname))
--
1.7.6.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists