aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorForty-Bot <Forty-Bot@users.noreply.github.com>2019-02-25 16:06:42 -0500
committerNikolaus Rath <Nikolaus@rath.org>2019-02-25 21:06:42 +0000
commit1cce958bb64c65228d74abcf4a444863d291734b (patch)
tree2c81bf8e0e1f07d6babf9ecaf1fab5080821317d /example
parent276728f70fc8923c90f1d2efaae8c7c8ce205b9b (diff)
downloadlibfuse-1cce958bb64c65228d74abcf4a444863d291734b.tar.gz
hello_ll: Fix null pointer dereference (#363)
If hello_ll is invoked without a mountpoint, it will try to call fuse_session_mount anyway with the NULL mountpoint (which then causes a segfault). Print out a short help message instead (taken from passthrough_ll.c).
Diffstat (limited to 'example')
-rw-r--r--example/hello_ll.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/example/hello_ll.c b/example/hello_ll.c
index 601cf93..97f3c50 100644
--- a/example/hello_ll.c
+++ b/example/hello_ll.c
@@ -183,6 +183,13 @@ int main(int argc, char *argv[])
goto err_out1;
}
+ if(opts.mountpoint == NULL) {
+ printf("usage: %s [options] <mountpoint>\n", argv[0]);
+ printf(" %s --help\n", argv[0]);
+ ret = 1;
+ goto err_out1;
+ }
+
se = fuse_session_new(&args, &hello_ll_oper,
sizeof(hello_ll_oper), NULL);
if (se == NULL)