Fix abort in fuse_new() compatibility API for opts == NULL case
authorMiklos Szeredi <miklos@szeredi.hu>
Thu, 18 Jan 2007 16:08:21 +0000 (16:08 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Thu, 18 Jan 2007 16:08:21 +0000 (16:08 +0000)
ChangeLog
lib/fuse.c

index ae90dfa57920668dab0a0ec1a5d1aab2c986abc8..3675c9ce646b1360ac1eef131932779489a78c2a 100644 (file)
--- 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,
index f63c866223d32f9b36eaf19e4212f06ff05f1f08..994a31f773dc341f4693f5e23b1f6e8a8fccfb05 100644 (file)
@@ -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;