8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 14:03:03 +01:00

Fix a case of deleted memory modification

cnctAuth and port->port_srv_auth point to the same object so useResponse must not be assigned if the object is deleted.
This commit is contained in:
Ilya Eremin 2024-08-21 10:23:03 +03:00 committed by Alexander Peshkov
parent 75042b58e1
commit 258584ff6d

View File

@ -2014,13 +2014,15 @@ static bool accept_connection(rem_port* port, P_CNCT* connect, PACKET* send)
{
ConnectAuth* cnctAuth = FB_NEW ConnectAuth(port, id);
port->port_srv_auth = cnctAuth;
if (port->port_srv_auth->authenticate(send, ServerAuth::AUTH_COND_ACCEPT))
if (cnctAuth->authenticate(send, ServerAuth::AUTH_COND_ACCEPT))
{
delete port->port_srv_auth;
delete cnctAuth;
port->port_srv_auth = NULL;
}
else
cnctAuth->useResponse = true;
cnctAuth->useResponse = true;
return true;
}