diff options
author | Forty-Bot <Forty-Bot@users.noreply.github.com> | 2019-02-25 16:06:42 -0500 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2019-02-25 21:06:42 +0000 |
commit | 1cce958bb64c65228d74abcf4a444863d291734b (patch) | |
tree | 2c81bf8e0e1f07d6babf9ecaf1fab5080821317d /example/hello_ll.c | |
parent | 276728f70fc8923c90f1d2efaae8c7c8ce205b9b (diff) | |
download | libfuse-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/hello_ll.c')
-rw-r--r-- | example/hello_ll.c | 7 |
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) |