From a93e5691369b0d0878f4434f980c79e94216775d Mon Sep 17 00:00:00 2001 From: Petr Uzel Date: Sun, 4 Jul 2010 20:02:57 +0200 Subject: [PATCH] libmount: fix merge_optstr (do not truncate 3 trailing characters) I believe this is the correct fix. Signed-off-by: Petr Uzel --- shlibs/mount/src/tab_parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c index 5dbcfa67..680e1fc1 100644 --- a/shlibs/mount/src/tab_parse.c +++ b/shlibs/mount/src/tab_parse.c @@ -254,7 +254,8 @@ static char *merge_optstr(const char *vfs, const char *fs) if (!strcmp(vfs, fs)) return strdup(vfs); /* e.g. "aaa" and "aaa" */ - sz = strlen(vfs) + strlen(fs) + 2; + /* leave space for leading "r[ow],", "," and trailing zero */ + sz = strlen(vfs) + strlen(fs) + 5; res = malloc(sz); if (!res) return NULL; -- 2.39.5