From ce355c80cf6054bfa5e1dcf81f9e2183ef963ee1 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Mon, 18 Sep 2023 22:58:34 +0200 Subject: Initialize slaveresult to 0 and use strncat instead of bsd strlcat diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index 8dc554f..9b7d13f 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c @@ -110,7 +110,7 @@ main (int argc, char **argv) char *result = NULL; char *error = NULL; - char slaveresult[SLAVERESULTSIZE]; + char slaveresult[SLAVERESULTSIZE] = { 0 }; char* perf; perf = strdup (""); @@ -299,7 +299,7 @@ main (int argc, char **argv) if (mysqldump_threads == 0) { die (STATE_CRITICAL, "%s\n", slaveresult); } else { - strlcat (slaveresult, " Mysqldump: in progress", SLAVERESULTSIZE); + strncat(slaveresult, " Mysqldump: in progress", SLAVERESULTSIZE-1); } } -- cgit v0.10-9-g596f