From c69658889cc7cd67f87c7d842bf210b7930fd7c8 Mon Sep 17 00:00:00 2001 From: counterpoint Date: Fri, 18 Sep 2015 08:59:06 +0100 Subject: [PATCH] Handle client input case where no router session exists by sending error message to client. --- server/modules/protocol/mysql_client.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/server/modules/protocol/mysql_client.c b/server/modules/protocol/mysql_client.c index 1f983650c..edda2b888 100644 --- a/server/modules/protocol/mysql_client.c +++ b/server/modules/protocol/mysql_client.c @@ -758,9 +758,9 @@ int gw_read_client_event( router = session->service->router; router_instance = session->service->router_instance; rsession = session->router_session; - ss_dassert(rsession != NULL); - if (router_instance != NULL && rsession != NULL) { + if (router_instance != NULL && rsession != NULL) + { /** Ask what type of input the router expects */ cap = router->getCapabilities(router_instance, rsession); @@ -820,7 +820,17 @@ int gw_read_client_event( goto return_rc; } } - } + else + { + /** Send ERR 1045 to client */ + mysql_send_auth_error( + dcb, + 2, + 0, + "failed to create new session"); + return 0; + } + } if (stmt_input) {