From: Sangwoo Moon Date: Wed, 27 Sep 2017 07:25:15 +0000 (+0900) Subject: Adding pointer dereferencing after calling dlsym() X-Git-Tag: fuse-3.2.1~6 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d92bf83;p=qemu-gpiodev%2Flibfuse.git Adding pointer dereferencing after calling dlsym() dlsym() resolves the location of the loaded symbol, therefore dlsym() returns the type (fuse_module_factory_t *), not (fuse_module_factory_t). Added pinter dereferencing to correctly refer the factory function. --- diff --git a/lib/fuse.c b/lib/fuse.c index 7b0b979..3a72cb5 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -263,7 +263,7 @@ static int fuse_load_so_module(const char *module) } sprintf(tmp, "fuse_module_%s_factory", module); - factory = dlsym(so->handle, tmp); + factory = *((fuse_module_factory_t *) dlsym(so->handle, tmp)); if (factory == NULL) { fprintf(stderr, "fuse: symbol <%s> not found in module: %s\n", tmp, dlerror());