From d67cea9b1a16a55664e486002a08cd5f829b6c7e Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 23 Jan 2020 08:53:40 +0100 Subject: [PATCH] Fixed NULL dereference. --- server/proxy/pf_modules.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/proxy/pf_modules.c b/server/proxy/pf_modules.c index 354781498..f70ebe930 100644 --- a/server/proxy/pf_modules.c +++ b/server/proxy/pf_modules.c @@ -210,7 +210,8 @@ static BOOL pf_modules_register_plugin(proxyPlugin* plugin_to_register) size_t index; proxyPlugin* plugin; - assert(plugins_list != NULL); + if (!plugin_to_register) + return FALSE; /* make sure there's no other loaded plugin with the same name of `plugin_to_register`. */ ArrayList_ForEach(plugins_list, proxyPlugin*, index, plugin) @@ -224,7 +225,8 @@ static BOOL pf_modules_register_plugin(proxyPlugin* plugin_to_register) if (ArrayList_Add(plugins_list, plugin_to_register) < 0) { - WLog_ERR(TAG, "[%s]: failed adding plugin to list: %s", __FUNCTION__, plugin->name); + WLog_ERR(TAG, "[%s]: failed adding plugin to list: %s", __FUNCTION__, + plugin_to_register->name); return FALSE; }