diff options
author | Petr Uzel <petr.uzel@centrum.cz> | 2010-07-04 20:02:57 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2010-07-07 10:06:16 +0200 |
commit | a93e5691369b0d0878f4434f980c79e94216775d (patch) | |
tree | abc1574ba9c620c2a146c71ed458ff2be980cf81 /shlibs | |
parent | 26907ffae0895b11991d2039b634557404e8130d (diff) | |
download | util-linux-old-a93e5691369b0d0878f4434f980c79e94216775d.tar.gz |
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')
-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 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; |