From 05c126c670a34c1a4ae18f606ae470ee995b72e8 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 18 Jan 2007 16:08:21 +0000 Subject: [PATCH] Fix abort in fuse_new() compatibility API for opts == NULL case --- ChangeLog | 5 +++++ lib/fuse.c | 5 +++-- 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 + + * 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; -- 2.30.2