From: Miklos Szeredi Date: Thu, 18 Jan 2007 16:08:21 +0000 (+0000) Subject: Fix abort in fuse_new() compatibility API for opts == NULL case X-Git-Tag: fuse_2_6_merge1~1 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=05c126c670a34c1a4ae18f606ae470ee995b72e8;p=qemu-gpiodev%2Flibfuse.git Fix abort in fuse_new() compatibility API for opts == NULL case --- diff --git a/ChangeLog b/ChangeLog index ae90dfa..3675c9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-18 Miklos Szeredi + + * Fix abort in fuse_new() compatibility API for opts == NULL case. + Novell bugzilla #233870. Patch from Takashi Iwai. + 2007-01-02 Miklos Szeredi * 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;