From 1cce958bb64c65228d74abcf4a444863d291734b Mon Sep 17 00:00:00 2001 From: Forty-Bot Date: Mon, 25 Feb 2019 16:06:42 -0500 Subject: [PATCH] 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). --- example/hello_ll.c | 7 +++++++ 1 file changed, 7 insertions(+) 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] \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) -- 2.30.2