From: Forty-Bot Date: Mon, 25 Feb 2019 21:06:42 +0000 (-0500) Subject: hello_ll: Fix null pointer dereference (#363) X-Git-Tag: fuse-3.4.2~10 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1cce958bb64c65228d74abcf4a444863d291734b;p=qemu-gpiodev%2Flibfuse.git 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). --- 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)