From: Petr Uzel Date: Sun, 4 Jul 2010 18:02:57 +0000 (+0200) Subject: libmount: fix merge_optstr (do not truncate 3 trailing characters) X-Git-Tag: v2.19-rc1~409 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a93e5691369b0d0878f4434f980c79e94216775d;p=thirdparty%2Futil-linux.git libmount: fix merge_optstr (do not truncate 3 trailing characters) I believe this is the correct fix. Signed-off-by: Petr Uzel --- diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c index 5dbcfa673b..680e1fc188 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;