From 76399200f4afb253f01de00f180556117893fb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 20 May 2019 15:43:40 +0300 Subject: [PATCH] Fix assertion on client SSL read When SSL is enabled, the protocol seems to get zero byte reads which result in a null GWBUF being passed to gwbuf_length. --- .../modules/protocol/MySQL/mariadbclient/mysql_client.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc index d8b007e90..3ce7c05ef 100644 --- a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc +++ b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc @@ -524,7 +524,13 @@ int gw_read_client_event(DCB* dcb) { dcb_close(dcb); } - if (0 == (nbytes_read = gwbuf_length(read_buffer))) + + if (read_buffer) + { + nbytes_read = gwbuf_length(read_buffer); + } + + if (nbytes_read == 0) { return return_code; }