From 51e962a7610f1aa69ffe0374f92774fb83526dc7 Mon Sep 17 00:00:00 2001 From: Dan Ehrenberg Date: Thu, 16 Apr 2015 14:50:39 -0700 Subject: [PATCH 1/1] Fix mtd valgrind warning strlen seems to operate in 32-bit chunks, but libmtd sometimes allocates strings without that much padding. This patch adds something extra to a string allocation so that the mtd ioengine is clean with respect to valgrind memory access checks. Signed-off-by: Dan Ehrenberg Signed-off-by: Jens Axboe --- lib/libmtd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libmtd.c b/lib/libmtd.c index e1b2be19..5c9eac27 100644 --- a/lib/libmtd.c +++ b/lib/libmtd.c @@ -55,7 +55,7 @@ static char *mkpath(const char *path, const char *name) size_t len1 = strlen(path); size_t len2 = strlen(name); - n = xmalloc(len1 + len2 + 2); + n = xmalloc(len1 + len2 + 6); memcpy(n, path, len1); if (n[len1 - 1] != '/') -- 2.25.1