From 5224fa5625b8a659daa7fbd8d40c53040664d3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 17 Dec 2019 09:19:11 +0200 Subject: [PATCH] MXS-2585: Add temporary workaround Added a debug assertion that will catch the problem in debug builds and some release mode code that prevents crashes if this ever happens. --- server/modules/routing/readwritesplit/rwsplitsession.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/modules/routing/readwritesplit/rwsplitsession.cc b/server/modules/routing/readwritesplit/rwsplitsession.cc index 32dd892e9..7f7258c25 100644 --- a/server/modules/routing/readwritesplit/rwsplitsession.cc +++ b/server/modules/routing/readwritesplit/rwsplitsession.cc @@ -119,6 +119,13 @@ void RWSplitSession::close() int32_t RWSplitSession::routeQuery(GWBUF* querybuf) { + if (!querybuf) + { + MXS_ERROR("MXS-2585: Null buffer passed to routeQuery, closing session"); + mxb_assert(!true); + return 0; + } + mxb_assert(GWBUF_IS_CONTIGUOUS(querybuf)); int rval = 0;