summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/tab_parse.c
diff options
context:
space:
mode:
authorPetr Uzel2010-07-04 20:02:57 +0200
committerKarel Zak2010-07-07 10:06:16 +0200
commita93e5691369b0d0878f4434f980c79e94216775d (patch)
treeabc1574ba9c620c2a146c71ed458ff2be980cf81 /shlibs/mount/src/tab_parse.c
parentswapon: Document btrfs limitation with swapfiles (diff)
downloadkernel-qcow2-util-linux-a93e5691369b0d0878f4434f980c79e94216775d.tar.gz
kernel-qcow2-util-linux-a93e5691369b0d0878f4434f980c79e94216775d.tar.xz
kernel-qcow2-util-linux-a93e5691369b0d0878f4434f980c79e94216775d.zip
libmount: fix merge_optstr (do not truncate 3 trailing characters)
I believe this is the correct fix. Signed-off-by: Petr Uzel <petr.uzel@centrum.cz>
Diffstat (limited to 'shlibs/mount/src/tab_parse.c')
-rw-r--r--shlibs/mount/src/tab_parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c
index 5dbcfa673..680e1fc18 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;