Package: zfs-fuse / 0.7.0-12

fix-segfault.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/zfs-fuse/main.c b/src/zfs-fuse/main.c
index e8191bc..c57fc01 100644
--- a/src/zfs-fuse/main.c
+++ b/src/zfs-fuse/main.c
@@ -401,8 +401,12 @@ static void read_cfg() {
 		{
 			// prepend dashes for short or long options
 			const char* original = argv[1];
-			if ('-'!=*original)
-				VERIFY(-1 != asprintf(&argv[1], strlen(original)>1? "--%s" : "-%s", original));
+			int original_len;
+			original_len = strlen(original);
+			if ('-'!=*original) {
+				argv[1] = malloc(original_len + 2);
+				snprintf(argv[1], original_len + 2, strlen(original)>1? "--%s" : "-%s", original);
+			}
 
 			// parse
 			parse_args(argc,argv);