blob: bf6574cdcc2cf3ea7d3bd2e4dcc87732b056983c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
commit a6c90fe597944f68fe49f45f1d8bc0d2e35104d4
Author: Petr Uzel <petr.uzel-aRb0bU7PRFPrBKCeMvbIDA@public.gmane.org>
Date: Sun Jul 4 20:02:57 2010 +0200
libmount: fix merge_optstr (do not truncate 3 trailing characters)
I believe this is the correct fix.
Signed-off-by: Petr Uzel <petr.uzel-aRb0bU7PRFPrBKCeMvbIDA@public.gmane.org>
diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c
index 5dbcfa6..680e1fc 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;
|