diff options
author | Petr Uzel | 2010-07-04 20:02:57 +0200 |
---|---|---|
committer | Karel Zak | 2010-07-07 10:06:16 +0200 |
commit | a93e5691369b0d0878f4434f980c79e94216775d (patch) | |
tree | abc1574ba9c620c2a146c71ed458ff2be980cf81 | |
parent | swapon: Document btrfs limitation with swapfiles (diff) | |
download | kernel-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>
-rw-r--r-- | shlibs/mount/src/tab_parse.c | 3 |
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; |