plugin-manager: don't crash when loading an invalid shared utils library
<wrn> [plugin-manager] could not load shared '/usr/lib/ModemManager/libmm-shared-xmm.so': Missing major version info Thread 1 "ModemManager" received signal SIGSEGV, Segmentation fault. 0x000055555562b79d in load_external_shared (path=<optimized out>, self=0x5555557b5880) at ../src/mm-plugin-manager.c:1885 1885 if (module && !(*shared_name)) (gdb) p module $1 = (GModule *) 0x5555557b9670 (gdb) p shared_name $2 = (const gchar **) 0x0
This commit is contained in:
@@ -1753,6 +1753,7 @@ load_shared (MMPluginManager *self,
|
||||
const gchar **shared_name = NULL;
|
||||
gint *major_shared_version;
|
||||
gint *minor_shared_version;
|
||||
gboolean success = FALSE;
|
||||
|
||||
/* Get printable UTF-8 string of the path */
|
||||
path_display = g_filename_display_name (path);
|
||||
@@ -1791,9 +1792,10 @@ load_shared (MMPluginManager *self,
|
||||
}
|
||||
|
||||
mm_obj_dbg (self, "loaded shared '%s' utils from '%s'", *shared_name, path_display);
|
||||
success = TRUE;
|
||||
|
||||
out:
|
||||
if (module && !(*shared_name))
|
||||
if (module && !success)
|
||||
g_module_close (module);
|
||||
|
||||
g_free (path_display);
|
||||
|
||||
Reference in New Issue
Block a user