From ea0b6b5ae68725af4f331db0f7561fab2248ea4b Mon Sep 17 00:00:00 2001 From: Dmitry Starodubov Date: Fri, 7 Oct 2022 14:44:33 +0300 Subject: [PATCH] Fixed possible crash when server-side authentication creates an empty plugin list --- src/remote/server/server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/remote/server/server.cpp b/src/remote/server/server.cpp index a3e9c43fde..d69d76e657 100644 --- a/src/remote/server/server.cpp +++ b/src/remote/server/server.cpp @@ -2026,9 +2026,9 @@ static bool accept_connection(rem_port* port, P_CNCT* connect, PACKET* send) HANDSHAKE_DEBUG(fprintf(stderr, "Srv: accept_connection: calls createPluginsItr\n")); port->port_srv_auth_block->createPluginsItr(); - if (port->port_srv_auth_block->plugins) // We have all required data and iterator was created + AuthServerPlugins* const plugins = port->port_srv_auth_block->plugins; + if (plugins && plugins->hasData()) // We have all required data and iterator was created { - AuthServerPlugins* const plugins = port->port_srv_auth_block->plugins; NoCaseString clientPluginName(port->port_srv_auth_block->getPluginName()); // If there is plugin matching client's one it will be HANDSHAKE_DEBUG(fprintf(stderr, "Srv: accept_connection: client plugin='%s' server='%s'\n",