Adding pointer dereferencing after calling dlsym()
authorSangwoo Moon <swmoon00@gmail.com>
Wed, 27 Sep 2017 07:25:15 +0000 (16:25 +0900)
committerNikolaus Rath <Nikolaus@rath.org>
Wed, 27 Sep 2017 14:01:55 +0000 (15:01 +0100)
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.

lib/fuse.c

index 7b0b979520eca445d95e55847eb6269ffd3ad5ec..3a72cb5b5c1dc0389e32e749991ea42588258932 100644 (file)
@@ -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());