summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2007-01-18 16:08:21 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2007-01-18 16:08:21 +0000
commit05c126c670a34c1a4ae18f606ae470ee995b72e8 (patch)
tree0a3006fd7c5e4adcb5833525ca38d42336f09e74
parentfac7b10214e25bc444ca947b770a9ae8227aaa79 (diff)
downloadfuse-05c126c670a34c1a4ae18f606ae470ee995b72e8.tar.gz
Fix abort in fuse_new() compatibility API for opts == NULL case
-rw-r--r--ChangeLog5
-rw-r--r--lib/fuse.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ae90dfa..3675c9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-18 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Fix abort in fuse_new() compatibility API for opts == NULL case.
+ Novell bugzilla #233870. Patch from Takashi Iwai.
+
2007-01-02 Miklos Szeredi <miklos@szeredi.hu>
* Fix unaligned access in file desctriptor passing in libfuse,
diff --git a/lib/fuse.c b/lib/fuse.c
index f63c866..994a31f 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -2948,9 +2948,10 @@ static struct fuse *fuse_new_common_compat(int fd, const char *opts,
struct fuse *f;
struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
+ if (fuse_opt_add_arg(&args, "") == -1)
+ return NULL;
if (opts &&
- (fuse_opt_add_arg(&args, "") == -1 ||
- fuse_opt_add_arg(&args, "-o") == -1 ||
+ (fuse_opt_add_arg(&args, "-o") == -1 ||
fuse_opt_add_arg(&args, opts) == -1)) {
fuse_opt_free_args(&args);
return NULL;