[vlc-commits] modules: do not pass NULL to dlsym()
    Rémi Denis-Courmont 
    git at videolan.org
       
    Mon Jul 22 20:14:46 CEST 2019
    
    
  
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 22 21:09:09 2019 +0300| [f4cd53df2100feb4f9a05b78a7b8b3bf5b333548] | committer: Rémi Denis-Courmont
modules: do not pass NULL to dlsym()
On GNU/Linux, NULL is aliases RTLD_DEFAULT, but this is neither portable
nor necessary for VLC functions.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4cd53df2100feb4f9a05b78a7b8b3bf5b333548
---
 src/modules/bank.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/modules/bank.c b/src/modules/bank.c
index 90266c0e0e..2f85b0776c 100644
--- a/src/modules/bank.c
+++ b/src/modules/bank.c
@@ -598,11 +598,12 @@ static void module_Unmap(vlc_plugin_t *plugin)
 void *module_Symbol(struct vlc_logger *log,
                     vlc_plugin_t *plugin, const char *name)
 {
-    if (module_Map(log, plugin))
+    if (plugin->abspath == NULL || module_Map(log, plugin))
         return NULL;
 
     void *handle = (void *)atomic_load_explicit(&plugin->handle,
                                                 memory_order_relaxed);
+    assert(handle != NULL);
     return vlc_dlsym(handle, name);
 }
 #else
    
    
More information about the vlc-commits
mailing list