From bc35730c736eeaea90b1911657d5e66dfabeac39 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Tue, 15 Mar 2016 16:37:12 +0200 Subject: [PATCH] Fixed a crash when a monitor has no servers If a monitor is configured with a server which does not exist, MaxScale will crash. --- server/core/monitor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/core/monitor.c b/server/core/monitor.c index 3af5e33fb..7793018f3 100644 --- a/server/core/monitor.c +++ b/server/core/monitor.c @@ -538,6 +538,12 @@ bool check_monitor_permissions(MONITOR* monitor) mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, &cnf->auth_conn_timeout); mysql_options(mysql, MYSQL_OPT_WRITE_TIMEOUT, &cnf->auth_write_timeout); + if (monitor->databases == NULL) + { + MXS_ERROR("%s: Monitor is missing the servers parameter.", monitor->name); + return false; + } + user = monitor->user; dpasswd = decryptPassword(monitor->password); server = monitor->databases->server;