diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-09-25 12:51:27 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-09-25 16:45:23 +0000 |
commit | 8615081a0910797a8dfab5ea60583f8f5da8d020 (patch) | |
tree | b9e322c97fba71747fd59210a8e30df74692e735 /wsutil/plugins.h | |
parent | 8b5b843fcbc3e03e0fc45f3caf8cf5fc477e8613 (diff) |
plugins: Fix crash loading binary module twice
If a plugin is repeated we destroy the GModuleHandle in plugins_scan_dir()
but we have already added the entry points to the list of registered
plugins.
Check for repeated plugins before adding it to the list of registered
plugins, not after.
Don't check for both name and version, check only for repeated names.
Give the plugin callback a more descriptive name.
Change-Id: I22cbbb059b8029877580fc33517310496c93e5d5
Reviewed-on: https://code.wireshark.org/review/23726
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'wsutil/plugins.h')
-rw-r--r-- | wsutil/plugins.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wsutil/plugins.h b/wsutil/plugins.h index 89751ee2fb..b3e96934b8 100644 --- a/wsutil/plugins.h +++ b/wsutil/plugins.h @@ -32,14 +32,14 @@ extern "C" { #include "ws_symbol_export.h" -typedef gboolean (*plugin_callback)(GModule *handle); +typedef gboolean (*plugin_check_type_callback)(GModule *handle); typedef enum { REPORT_LOAD_FAILURE, DONT_REPORT_LOAD_FAILURE } plugin_load_failure_mode; WS_DLL_PUBLIC void scan_plugins(plugin_load_failure_mode mode); -WS_DLL_PUBLIC void add_plugin_type(const char *type, plugin_callback callback); +WS_DLL_PUBLIC void add_plugin_type(const char *type, plugin_check_type_callback callback); typedef void (*plugin_description_callback)(const char *, const char *, const char *, const char *, void *); |