From 057b8d7dde25f638a13de45d8e3fcb51da7fb28d Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 13 Jan 2016 13:04:24 +0100 Subject: plugins: do not import symbols globally Clang's ASAN reported an ODR violation when plugins were loaded. Sure enough, symbols did actually get loaded twice: ==5898==ERROR: AddressSanitizer: odr-violation (0x7fffd95a35e0): [1] size=7 'version' plugins/mate/plugin.c:19:31 [2] size=6 'version' plugins/opcua/plugin.c:19:31 After this change, plugins cannot insert new symbols in the global namespace. Change-Id: Ib11f7263e9c586f8e7c1f8f5fb239b20d46ddd2f Reviewed-on: https://code.wireshark.org/review/13260 Reviewed-by: Alexis La Goutte Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- wsutil/plugins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wsutil') diff --git a/wsutil/plugins.c b/wsutil/plugins.c index 64a8a66a26..ec3800bdf0 100644 --- a/wsutil/plugins.c +++ b/wsutil/plugins.c @@ -172,7 +172,7 @@ plugins_scan_dir(const char *dirname) g_snprintf(filename, FILENAME_LEN, "%s" G_DIR_SEPARATOR_S "%s", dirname, name); - if ((handle = g_module_open(filename, (GModuleFlags)0)) == NULL) + if ((handle = g_module_open(filename, G_MODULE_BIND_LOCAL)) == NULL) { report_failure("Couldn't load module %s: %s", filename, g_module_error()); -- cgit v1.2.3