From 8c437c6440caf6b556f3429f03802d5907620338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 4 Jan 2019 12:00:48 +0200 Subject: [PATCH] Fix crash in galeramon An std::string was assigned a null value which will cause a crash. --- server/modules/monitor/galeramon/galeramon.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/monitor/galeramon/galeramon.cc b/server/modules/monitor/galeramon/galeramon.cc index c37aa0400..1d3ceaa3b 100644 --- a/server/modules/monitor/galeramon/galeramon.cc +++ b/server/modules/monitor/galeramon/galeramon.cc @@ -208,9 +208,9 @@ void GaleraMonitor::update_server_status(MXS_MONITORED_SERVER* monitored_server) info.local_state = atoi(row[1]); } - if (strcmp(row[0], "wsrep_cluster_state_uuid") == 0) + if (strcmp(row[0], "wsrep_cluster_state_uuid") == 0 && row[1] && *row[1]) { - info.cluster_uuid = row[1] && *row[1] ? MXS_STRDUP(row[1]) : NULL; + info.cluster_uuid = row[1]; } }