Fix use-after-free in LocalClient

If the DCB was closed before the handshake for the LocalCliet connection
was received, the gw_decode_mysql_server_handshake would use the closed
DCB to log the connection ID. Clearing out the pointer prevents it.
This commit is contained in:
Markus Mäkelä
2019-04-17 16:22:58 +03:00
parent 64e282f74b
commit 03dc969cf2

View File

@ -32,6 +32,8 @@ LocalClient::LocalClient(MYSQL_session* session, MySQLProtocol* proto, int fd)
, m_self_destruct(false)
{
MXB_POLL_DATA::handler = LocalClient::poll_handler;
m_protocol.owner_dcb = nullptr;
m_protocol.stored_query = nullptr;
}
LocalClient::~LocalClient()